Just tried the excellent Tag-It! plug-in for jquery (http://aehlke.github.com/tag-it/), but I can\'t get it to work how I would like.
I have an object list like this:
Here's another workaround (assuming you want to use data-id attribute):
var clone = $('#tags').clone();
// important to clone before calling tagit()
$('#tags').tagit({
beforeTagRemoved: function(event, ui) {
var item_id = clone.find('li:contains('+ui.tagLabel+')').data('id');
// do something with item_id / tag ui
}
});
Accompanying HTML: