newbie jquery advice
newbie jquery advice
Wow cool - a jquery forum! Just what I needed
I'm just starting out with jquery and need some advice on how to build this.
I'd like to have a list of DIVs that can be added and removed from a list. There is a button to remove each item, and a button that saves the order of the list. Bascially, it looks like this:
<DIV id="Container">
<!-- An "item" there can be a bunch of theses -->
<DIV class="item">
<SPAN class="close">Remove Me</span>
</DIV>
<a href="#">Save Me</a>
</DIV>
So, my first question is - how can I duplicate those items with a jquery script? Each has to be assigned an ID from a database as well.
Secondly, how to remove them? And finally - how to call up the IDs of each of item?
For the first part (adding items) I figure I can use the .add() function to write in another div in and pass it the ID. Thats cool, but I don't see a "remove" function.
And lastly for getting all the IDs and the order I think I'll need one of the traversing methods, but I'm not really sure where to start there....
Thanks in advance for your advice!
jq