i have this select option html with custom attribute
<select id='voucher_dealer' name='voucher_dealer' class='form-control'><option value=''>اختر موزع</option>
@foreach($dealers as $dealer)
<option dealername='awad' value='{{$dealer->id}}'>{{$dealer->dealer_name}}</option>
@endforeach
</select>
now i want to get the value of dealername i did this
$("#voucher_dealer").change(function(){
var dealer = $(this).val();
var dealername = $(this).attr("dealername");
alert(dealername);
});
i get undefined how i can get the value of the attribute dealername