Reputation: 2815
I have a div
and i insert a data-test
attribute in it :
<div id="container">
<div data-test="test"></div>
</div>
Now i want to find inner div , with this expression :
alert($("#container").find("[data-test=test]").length);
But this is not working . Whats the problem here?
Upvotes: 0
Views: 116
Reputation: 5603
try quoting your value:
alert($("#container").find('[data-test="test"]').length);
Upvotes: 1