Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 377261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:40:45+00:00 2026-05-12T14:40:45+00:00

The first click expands the <option> , the second click select one of them.

  • 0

The first click expands the <option>,

the second click select one of them.

How to catch the second click?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:40:45+00:00Added an answer on May 12, 2026 at 2:40 pm

    You can chain some events using jQuery’s one function like this:

    $('select').one('click', firstClick);
    
    function firstClick(evt) {
        //do anything you might want to do
        $(evt.target).parent().one('click', secondClick);
    }
    
    function secondClick(evt) {
        //again, do you thing
        $(evt.target).parent().one('click', firstClick);
    }
    

    The one function 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 the blur event to reset the first handler.

    You could also use jQuery’s live function 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.

    $('select option').live('click', selectHandler);
    
    function selectHandler(evt) {
        //insert magic here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I listen for 2 click events. First one fires when checkbox is checked: $('#example').on('click',
I need a listbox that selects on first click and un-selects on second click,
Please visit this link Click on first Image. Now is showing the Modal page
My Requiremet is when i Click on first button ,my panel should me me
Every time you start Visual Studio, the first time you click Add Reference to
I want to attach a 'click' event handler to the first child of an
When I click on the button, the first time, everything works fine, but the
Can anyone else make and compile this program( Click here) up until the first
I have a form that when my users click submit, I first want to
$(a.close).click(function() { var id = $(this).attr(id); alert(id); $(this).parents(div.venue:first).fadeOut(Fast); return false; }); Any ideas why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.