The first click expands the <option>,
the second click select one of them.
How to catch the second click?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can chain some events using jQuery’s
onefunction like this:The
onefunction will execute the event handler you give once and then remove it. This solution allows you to switch the handler on every click. Just be careful if you use this one. You also need to handle theblurevent to reset the first handler.You could also use jQuery’s
livefunction to minimize the number of event handlers you are creating, saving memory. This will also avoid some problems I could foresee with my first solution.