Jquery 获取select 自定义标签数据
html
<select id="methodSelect" name="method">
[#list orderPayments as orderPayment]
<option value="${orderPayment.paymentMethod}" data-amount="${orderPayment.amount}">${orderPayment.paymentMethod}<\/option>
<option value="${orderPayment.paymentMethod}" data-amount="${orderPayment.amount}">${orderPayment.paymentMethod}<\/option>
<option value="${orderPayment.paymentMethod}" data-amount="${orderPayment.amount}">${orderPayment.paymentMethod}<\/option>
[/#list]
<\/select>
js
$("body").on("change", "#methodSelect", function () {
alert($(this).find("option:selected").data("amount"));
})