How can I detect in jQuery when any option in a select tag has been changed?
For example [pseudocode]:
event handler function -> option changed(){
//do some stuff
}
EDIT:
I have the following select:
<select id = "selectattribute">
<OPTION VALUE="0">Choose Attribute</OPTION>
<?php echo($options);?>
</select>
I am trying this in jQuery:
$(document).ready(function() {
$("#selectattribute").change(function() {
alert('Handler for .change() called.');
});
});
Nothing happens...the function isn;t triggering.
EDIT: it works when I use $("#select") instead of $("#selectattribute")...can you not apply it to particular select tags?