Possible Duplicate:
Jquery selectors on custom data attributes on HTML5
How can I select all td
with html data attribute equal to some value?
E.G. Fiddle
$("td").dblclick(function (e) {
var columnNumber = $(this).data('column');
console.log(columnNumber);
$("td column=" + columnNumber).css('background-color', 'blue');;
});
here is the good syntax :
$("td[data-column='"+columnNumber+"']")
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