.click only working on one button? [jquery]
Posted: Fri Jun 11, 2010 8:38 pm
I have two divs that act as a container(like a tab control). At the bottom, I have a span button setup so when I click the X, it hides that dive. This works with the first #trialineate button, but does absolutely nothing for the second #redeemed button. Why is .click only working for one button?
...
Code: Select all
$("#hidetab").click(function() {
tab = $(this).find('a').attr("href");
alert(tab);
$(tab).slideUp('fast');
return false;
});
});Code: Select all
<div id="trialineate" class="tab_content">
...
<span style="text-align: right; width: 100%;display:block;" id="hidetab"><a href="#trialineate">x</a></span>
</div>
<div id="redeemed" class="tab_content">
...
<span style="text-align: right; width: 100%;display:block;" id="hidetab"><a href="#redeemed">x</a></span>
</div>