A working JSFIDDLE
You can do something like this:
var y = [1, 2, 2, 3, 2]
var removeItem = 2;
y = jQuery.grep(y, function(value) {
return value != removeItem;
});
Result:
[1, 3]
http://snipplr.com/view/14381/remove-item-from-array-with-jquery/
More Related Contents:
- Pass array to ajax request in $.ajax() [duplicate]
- how to store an array in jquery cookie?
- How to send request parameter array to servlet using jQuery $.ajax?
- What makes a jQuery object show up as an array in Chrome’s Developer Tools?
- jQuery parse JSON multidimensional array
- jquery array group by
- Rails not decoding JSON from jQuery correctly (array becoming a hash with integer keys)
- AJAX Post of JavaScript String Array to JsonResult as List Always Returns Null?
- jQuery .inArray() always true?
- Store and use an array using the HTML data tag and jQuery
- how to fetch array keys with jQuery?
- Any way to make jQuery.inArray() case insensitive?
- Prevent users from submitting a form by hitting Enter
- Selecting element by data attribute with jQuery
- How can I get the button that caused the submit from the form submit event?
- How to limit the number of selected checkboxes?
- Regular expression field validation in jQuery
- Callback of .animate() gets called twice jquery
- How to create separate Fancybox galleries on the same page?
- jQuery .ajax() POST Request throws 405 (Method Not Allowed) on RESTful WCF
- jQuery-UI is not working in my userscript without CSS, or with customization?
- Multiple Parameters for jQuery selector?
- When to choose mouseover() and hover() function?
- jQuery DataTables – Filter column by exact match
- Why is z-index ignored with position:static?
- Count elements with jQuery
- how can I use data posted from ajax in flask?
- How to cancel a jquery.load()?
- is it possible to remove an html comment from dom using jquery
- How can I list the uploads from a YouTube Channel?