Jquery Class - Add An Increment To It
问题 I am trying to add a dynamically-generated number at the end of "myclass" in Jquery. So I want it to increment a number at the end like this: myclass1 myclass2 myclass3 myclass4 I've tried a few times but have no clue what I'm doing. Any help would be great! var f=1;for(var g=0;g<d.count;g++)for(var f=1; f<3; f++){e.append("<li class='myclass"+f+"'><a>"+f+"</a></li>");f++} 回答1: I am not sure what you are trying to do, but here's my take on it. Of course, you can be more specific on the jQuery