I have some simple jQuery toggle script like this:
<script type="text/javascript">
$(document).ready(function() {
$('#clickedit').click(function() {
$('#st').toggle();
});
});
</script>
And, of course, in my HTML I have some
<div id="clickedit">CLICK ITEM TO TOGGLE</div>
<div id="st">content to show/hide</div>
Now... If I am working with PHP and I am iterating through few 'items' and each 'item' has his content to show/hide I cannot set static ids to my divs because script just won't work. I can assign some item's id to my divs (something like echo "<div id='clickedit".$id."'>"; and echo "<div id='st".$id."'>";) but I don't know how to handle them in my jQuery script! I am just discovering jQuery and it is brilliant, but still confusing to me :) So any help would be great!
Thanks in advance!