13

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');;
});
Community
  • 1
  • 1
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348

1 Answers1

31

here is the good syntax :

$("td[data-column='"+columnNumber+"']")
Yukulelix
  • 1,072
  • 2
  • 13
  • 19