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

  • Home
  • SEARCH
  • 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 7772863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:58:44+00:00 2026-06-01T16:58:44+00:00

I am using onclick event in option tag for select box <select> <option onclick=check()>one</option>

  • 0

I am using onclick event in option tag for select box

<select>
    <option onclick="check()">one</option>
    <option onclick="check()">two</option>
    <option onclick="check()">three</option>
</select>`

onclick event is not working on IE and Chrome but it is working fine in firefox,
here I don’t want to use onchange event on select tag bcz it will not trigger an event if user selects same option again

Eg:say first time user selects “one” dropdown I will open a popup after processing some stuff user closes the popup,suppose if user wants to select same “one” dropdown it will not trigger any event.this can be solved using onclick event on option tag but its not working on IE and chrome

Is there any work around for this ?

  • 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-06-01T16:58:45+00:00Added an answer on June 1, 2026 at 4:58 pm

    onclick event on option tag will fail on most versions of IE, Safari and Chrome: reference

    If you want to trigger an event whenever user select, why not simply use:

    <select onclick="check()">
    <option>one</option>
    <option>two</option>
    <option>three</option>
    

    And if you want to do something with the specific option user selected:

    <select onclick="if (typeof(this.selectedIndex) != 'undefined') check(this.selectedIndex)">
    <option>one</option>
    <option>two</option>
    <option>three</option>
    

    This way you are guaranteed to call check() if and only if an option is selected.

    Edit: As @user422543 pointed out in the comments, this solution will not work in Firefox. I therefore asked another question here: Why does Firefox react differently from Webkit and IE to "click" event on "select" tag?

    So far it seems using <select> tag is will not work consistently in all browsers. However, if we simulate a select menu using library such as jQuery UI select menu or Chosen to create a select menu instead of using <select> tag, click event will be fired on <ul> or <li> tag which is consistent in all browsers I tested.

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

Sidebar

Related Questions

I'm using arbor.js to create a graph. How do I create an onclick event
How can I insert jquery inside an html tag like using it in onclick
I am trying to add options to a select in its onclick event and
I know one can set plugin options, after things are set. But I'm not
I'm using jquery uniform on one of the project I'm working on. Since this
Hi i am using Ajax to get a SELECT tag. I mean, if i
This is not just for Google Chrome extension but also for JavaScript I am
My solution is using onClick event to call a PHP page, post parameters and
What is the difference between using the OnClick attribute of an ASP.Net Button: <asp:Button
I am using elemntFromPoint in order to return onclick some element. I would like

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.