Is there an event handler for selecting a particular option in a select element? (jQuery)?
-
I need a jQuery method to act as an event handler that is triggered when someone selects an option from an HTML select element. It is NOT in a form, and I need to be able to have separate handlers for specific options inside the select menu. Thanks in advance, -Luther
-
Answer:
Indeed the change event is the one you're looking for, to get the selected option: $('select#mySelect').change(function()… $option = $(this).children(':selected'); });
Luther at Yahoo! Answers Visit the source
Other answers
is this function useful http://api.jquery.com/select/
CHANGE
Related Q & A:
- How to delete a particular line from a file?Best solution by Stack Overflow
- How to have a mouseover event fire only if the mouse is hovered over an element for some time?Best solution by Stack Overflow
- How to hijack an event handler?Best solution by TeX - LaTeX
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- How many rounds are there in a regular PGA Event? And How many rounds are there in a major PGA Event?Best solution by answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.