Here it is my html code
<select class="changeOption"> {% for dBoy in dBoyList %} <option value="{{dBoy.id}}" data-locid='{{dboy.location.id}}' {% endfor %} </select>
When I select any option from the drop-down list, it shows undefine
JQuery code
$( ".changeOption" ).change(function() { var locId = $(this).data("locid") alert("id: "+locId); });
source share