I'm looking in parent divs for child elements that have a specific HTML5 data attribute. This code was working fine:
$('#parent').find('*[data-something]').css('color', 'red');
Then I found out that you can find HTML data attributes using Jquery's data object http://api.jquery.com/data/#data-html5
So I tried...
$('#parent').find($("#parent").data("something")).css('color', 'red');
...and it doesn't work. Does anyone know why?
JSFIDDLE: http://jsfiddle.net/Qct9v/
Note: I have to use find() because I need to search child elements.
.datadoes.