I want to remove particular value from the array. I have written code like:
$(".remove", document.getElementById("TXT")).live("click", function () {
$(this).parent().remove();
var removeitem = $(this).parent().attr('id');
pushvar.splice($.inArray(removeitem, pushvar), 1);
});
In the above code pushvar is an array. Suppose if it contains 3 elements.The function will repeat for three times when we click on one of the remove button. For eg the pushvar contains [5,6,7] elements. If i click on the remove button of 6. Then the function will repeat for three times. But the
pushvar.splice($.inArray(removeitem, pushvar), 1);
will remove all the three elements. But i want to remove only 6 from the array when i click on remove class. How can i do this.
.live()is deprecated. api.jquery.com/live use.on()insteadidcannot be just a number