Renumbering numerically ordered div ID's when adding one in the middle with Javascript

Posted by DavidR on Stack Overflow See other posts from Stack Overflow or by DavidR
Published on 2010-05-10T22:26:38Z Indexed on 2010/05/10 22:34 UTC
Read the original article Hit count: 194

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery