You’re adding the event handler to the <select>
element.
Therefore, $(this)
will be the dropdown itself, not the selected <option>
.
You need to find the selected <option>
, like this:
var option = $('option:selected', this).attr('mytag');
Reference link – https://stackoverflow.com/questions/2230704/jquery-getting-custom-attribute-from-selected-option