Use of next() and parent() with next <table>
Hello,
current state:
html.html
<div class=main>
<
p>bla<a id=hide>hide</a></p>
<
table><tbody>[..]</tbody></table>
<
p>bla<a id=hide>hide</a></p>
<
table><tbody>[..]</tbody></table>
<
p>bla<a id=hide>hide</a></p>
<
table><tbody>[..]</tbody></table>
</
div>
js.js
$("#hide").click(function(){
$(
this).parent('p').next('table').hide();
});
I need to hide the "next" table.
But with my given example above, it just works for the first <a> Element.
In fact, if I press another the second or third nothing happend.
But why ?
I cant get the reason... how can I hide the next table after the <p> tag ?
Thanks & Regards,
Mike