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');;
});
0

1 Answer 1

31

here is the good syntax :

$("td[data-column='"+columnNumber+"']")
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.