Show hide multiple divs independently without #ID - Help
Hi all, I am new to jquery and need some help with this…
I have the following simplified html….
-
<div class="article">
<a href"#" class="toggle">toggle div A</a>
<div class="divA">some content</div>
</div>
<div class="article">
<a href"#" class="toggle">toggle div A</a>
<div class="divA">some content</div>
</div>
I need to toggle the div.divA by clicking the a.toggle, but this needs to be independent to each container div.article. There will be arounf 10 div.artcile on a page and I cannot give the container an ID.
I have been playing with this but cannot get it to work for multiple div.article per page only when there is one per page.
-
$(document).ready(function(){
$(".toggle").click(function(){
$(".divA").slideToggle("slow");
});
});
any help would be much appreciated…
Thanks Jon