here is my web page : please check
I have placed two links in the page, clicking on the first link alerts the text in each div and its element position (index). clicking on the second link change the position of the last div to the position of the second div and vice versa. now the last div on the second position but its index doesn’t change.(again click on the first link) The third element is in the second position and its index is still 3, it shouldn’t be 2 ? or how can I update the element index as it moves from one position to another ? Please help
Thank you very much
As MvanGeest commented:
When you click you see this:
But what the browser does is this:
So the order is still 1,2,3 … ok EDIT what you want to do is add something like this to your move function:
this will move the 3rd element after the 1st so the browser sees it like you do.