I’m going to have a unordered list (<UL>) of items. Each item will have a delete button, which will make an ajax call & then remove the item from the list. I have all the info I need to make the Ajax call, but I’m wondering the best way to let the user remove any item in the list.
My first thought is to dynamically assign each <LI> a unique class identifier & then use jquery’s remove() on each element, but is there a better way? I have a feeling my approach is somewhat ham-fisted.
No need to invent some unique class names (you meant unique identifiers, right?
id, notclass).Just use the clicked button to find its parent
li.