I am trying to create a tagging system just like SO has. I have added the tags,now I want to remove them.
MyQuestion:
- How do I remove the tags appended?
- how do I make the cross button(a span) look identical to that in SO tagging system?
var tags = [];
$("#textBox").keypress(function (e) {
if (e.which === 13) {
$(".target").append("<a href='#' class='tag' >" + this.value+'<span class="cross" onclick="remove_tag()">X</span>'+ "</a>");
function remove_tag(){
//what to do here?
}
tags.push(this.value);
this.value = "";
}
});