Ben bu gibi bazı basit jQuery geçiş senaryosu var:
<script type="text/javascript">
$(document).ready(function() {
$('#clickedit').click(function() {
$('#st').toggle();
});
});
</script>
Ve, tabii ki, benim HTML bazı var
<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!