I have this jQuery statement :
$(document).ready(function() {
$('#toggle-link').click(function(){
$(this).text($(this).text() == '+' ? '-' : '+');
$('#box-to-toggle').toggle();
});
});
I have several instances of the #box-to-toggle so when i click on the #toogle-link link every instance of the box opens and closes. Can anyone tell me how to resolve this so the link only opens the box in the same div. here is the html structure.
<div id='holder'>
<div id='toggle-link'>+</div>
<div id='box-to-toggle'>
<!-- hide / show content here -->
</div>
</div>
<div id='holder'>
<div id='toggle-link'>+</div>
<div id='box-to-toggle'>
<!-- hide / show content here -->
</div>
</div>
<div id='holder'>
<div id='toggle-link'>+</div>
<div id='box-to-toggle'>
<!-- hide / show content here -->
</div>
</div>
<div id='holder'>
<div id='toggle-link'>+</div>
<div id='box-to-toggle'>
<!-- hide / show content here -->
</div>
</div>
Any help would be appreceatied