Suppose you have 10 comments listed on a page,
when you show it from the server, save the score on your server script, for example,
<div id="1">comment1</div> <div id="2">comment2</div> <div id="3">comment3</div> etc...
if it is any other content such as an image, you can use
<...name="1"....>
you can now handle them in a loop like this,
for(i++){ getElementById(i);
further, if you have a specific name for the element, you can match with "i" as getElementById ("comment" + i);
Suggestion: you can use jquery to do it for you
. toggle () . show () .hide () might be a good idea to watch .. Good luck :)
source share