I am unable to catch the data-attribute after the applying jQuery UI select menu on it.
How is it possible to get the data?
HTML:
<select class="drpmnu">
<option data-timings="something1">(01)</option>
<option data-timings="something2">(02)</option>
</select>
JavaScript:
$(".drpmnu").selectmenu({
change: function( event, ui ){
console.log($(this).data('timings'));
}
});
this
refers to the selectmenu itself, not the object in it. You need to useui.item
for that: