xxxxxxxxxx
//get the result as array
<option value="<?php echo $value['id']; ?>" data-count="5">
</option>
var data = $('.myclass').map(function() {
return $(this).data('optionid');
}).get();
xxxxxxxxxx
/* html */
<a data-id="123">link</a>
/* js */
$(this).attr("data-id") // returns string "123"
$(this).data("id") // returns number 123 (jQuery >= 1.4.3 only)
xxxxxxxxxx
<a data-id="123">link</a>
var id = $(this).data("id"); // Will set id to 123
xxxxxxxxxx
$('input[type=radio][name=supplier_price]').change(function () {
var $id = $(this).val(),
$price = $(this).data('price'),
$intend_price = $(this).data('intend-price'),
$product__month_price = $('#product__month_price'),
$product_price = $('#product_price');
console.log($price, $intend_price);
});