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 7630515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:07:30+00:00 2026-05-31T06:07:30+00:00

I have an html select: <select> <option>Choose one</option> </select> Using jQuery, is there an

  • 0

I have an html select:

<select>
    <option>Choose one</option>
</select>

Using jQuery, is there an event I can capture for when the select option list has been revealed? (the reason I need this is because I want to defer population of the list until the moment the list needs to be displayed to the user).

mousedown works for when they click on it, but doesn’t do anything if they tab to it and press enter.

focus also works for clicking, and almost works for tabbing to it, but it immediately fires upon tabbing to it rather than waiting until they press enter to reveal the option list. (This is a problem because if they tab to it and then tab on without pressing enter, I don’t want the event to fire).

I even came up with this abomination:

var select_reveal = function(ev) { ... }
$('select').on('mousedown', select_reveal).on('keydown', function(ev) {
    // character code 9 is tab
    if (ev.which !== 9) select_reveal.bind(this)(ev);
});

This actually seems to work. It even works for the case where they type an alphabet letter (it populates the list then jumps to the first option starting with that letter). But as I said, this is somewhat of an abomination. It’s also a little hacky just checking for “tab” as an exception — there are definitely other exceptions that won’t cause the select to be revealed.

Is there a simple event that covers this use case (or at least something less abominable that covers it)?

(Note: I know there are alternatives to structuring the system like this — for example, by populating the options ahead of time as they change rather than on the select reveal; but I’m not looking for alternative suggestions, just wondering if there is a solution to the problem explicitly posed).

  • 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-31T06:07:31+00:00Added an answer on May 31, 2026 at 6:07 am

    I’m not sure which browsers you intend to support but before you get too far down this path please be aware that if you change the content of the select list (e.g. add/change/remove options) that IE will actually swallow the (mouseclick or focus) event that would open the list and leave the user with a closed select list. See here for details: http://webbugtrack.blogspot.com/2009/02/bug-487-onclickonfocus-bugs-on-select.html

    I think if you really feel there will be a benefit to delaying the load… I would hide/disable the select list on initial load, and trigger an async load of the options after it has been rendered… re-enabling/showing the select when it is ready.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a HTML select box like below. <select name=item_1> <option value=0>Choose one...</option>
I have this HTML: <select multiple='multiple' size='3'> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> Using
I have a HTML select list, which can have multiple selects: <select id=mySelect name=myList
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
I have this html... <select id=View name=View> <option value=1>With issue covers</option> <option value=0>No issue
I have the following HTML <select> element: <select id=leaveCode name=leaveCode> <option value=10>Annual Leave</option> <option
I have the following HTML: <div style=30px;> <table width=100%;> <tr> <td> <SELECT name=guidelinks> <OPTION
if i have a dropdown with the following html: <select id=myDropdown name=myDropdown> <option value=6>Six</option>
Let's say I have the following in my HTML code: <select name=Currency id=Currency> <option
Does the HTML select element have an on select event? what exactly is the

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.