I have the following html convertd to haml:
%input#insurance_isp_payment{ checked: "checked", type: "radio", name: "insurance_isp_payment", price: 27.22, value: "single"}
27,22 €
And now I want to get this price value from radio button which is checked. I tried something like that:
$('input[name=insurance_isp_payment]:checked').data("price")
But this not work. How can I solve this problem?
Try this : instead of data()
use attr()
to get the price value.
var price = $('input[name="insurance_isp_payment"]:checked').attr("price");
alert(price);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With