xxxxxxxxxx
var option = $('option:selected', this).attr('mytag');
xxxxxxxxxx
var option = $('option:selected', this).attr('mytag');
or
$('#location').find('option:selected').attr('myTag');
xxxxxxxxxx
$("#pur_rate").val($("#vendor_item option:selected").attr("purchase_rate"));