Make a function similar to answering questions. The problem now is that the first question was originally
Then I clicked on the second question after .1 (which is li)
Then mainly look at this traversal
I removed the li from the previous question first, and then added the new one, but I don’t know why there is only one
But it’s less than 1. Please help, what is the problem?
remove()
is to clear everything and move it out of the loopYou just need to remove li outside $.each. Because you perform the remove operation every time you loop, there is only one left