How can I get the id
of the element that triggered the jQuery .change()
function?
The function itself works properly, but I need a specific action for a selector with id="next"
.
$("select").change(function() {
[...snip....]
alert( $(this).attr('id') ); // <---- not working
}
Any ideas why the alert above isn't working?
This question is related to
javascript
jquery
html
Do you mean that for a select element with an id of "next" you need to perform some specific script?
$("#next").change(function(){
//enter code here
});
Source: Stackoverflow.com