I’m developing an application with javascript. What I need is to have divs with id’s (1,2,3…) and be able to insert a div between, for example, 2 and 3, with jquery, and then have that be the new three, and three becomes four, four becomes five, etc. I’ve got the div insertion working, I just need to know how to reorder the divs. Any ideas?
Share
After you inserted the new div, you can do this:
Replace $(‘div’) by your own selector.
Remember also that, depending on which version of HTML you use, id’s can’t start with a number.