i add a attr: data-id to an input text how to get the value?
Hi friends simple question i have this:
<input type='text' name='xtarima_izq_0' class='inputNoTarima2' id='xtarima_izq_0' size='10' value='' data-id='1222' autofocus>
<button id="btnExecute">Test</button>
and i try get the value of data-id attr in this case: 1222
i try:
$(document).ready(function () {
$('#btnExecute').on('click', function () {
alert($("#xtarima_izq_0").dataset.id);
});
});
here the fiddle:
but not luck!!!
thanks