SyntaxFix
Write A Post
Hire A Developer
Questions
In your codethis refers to the select element not to the selected option
this
to refer the selected option you can do this -
$(this).find('option:selected').attr("name");