jQuery method of deleting an array element based on the element value

  • 2020-06-19 09:43:52
  • OfStack

This article shows an example of how jQuery removes elements of an array based on their value. Share to everybody for everybody reference. The details are as follows:

For example, remove the element C without knowing that C is in the subscript of the array


var arr = ['a','b','c','d'];
arr.splice($.inArray('c',arr),1);
alert(arr);

Hopefully, this article has been helpful in your jQuery programming.


Related articles: