JQuery interacting with select boxes

If you want to find the value for a select box with JQuery it's easy:

$("#selector").val();

What if you want to find the text of the selected element? Find the option elements inside the select, and filter for the :selected one!

$("#selector option:selected").text();


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 18.216.94.152
To prevent spam please submit by clicking the kitten: