search

Home  >  Q&A  >  body text

php - html+jquery problem

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?

高洛峰高洛峰2793 days ago617

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-17 09:57:46

    remove() is to clear everything and move it out of the loop

    reply
    0
  • 迷茫

    迷茫2017-05-17 09:57:46

    You just need to remove li outside $.each. Because you perform the remove operation every time you loop, there is only one left

    reply
    0
  • Cancelreply