Select Element whose ID is attribute in another Element
How do I select an element whose ID is given in an attribute of another
element?
<div id="_News" class="link active" data-wife="News">News</div>
I want to grab the element with the ID given in data-wife. I've tried
something like
$("'#" + $(this).attr("data-wife") + "'").show();
but it looks totally wrong to me (and does not work, of course..).
No comments:
Post a Comment