I am using jquery ui draggable and am allowing the user to change the order of a list, when they are done I plan to have them click a button and I will create a json file with their current list order, what is the best way to do something like this using jquery since the list order is not written on html file?
ps: each li tag and ul tag may have an id.
Expanding on Kim’s answer. If you are not guaranteed each item has an id and since you are using jQuery. You should use the jQuery.data() or jQuery data() to attach context to the items so you know which one is which. It will look something like this if that context is just the original order.
Then when you are saving it you can loop through again and pull that index value out. If there is some other defining value that would make these unique it would be easier for you than an index. Something like a GUID really comes in handy in situations like this.