Introduction:
Here I will explain how to use jQuery to add items or elements to an array if not exists in list with example. By using inArray property we can check whether elements exists or not in array using jQuery.
Description:
In previous articles I explained jQuery currency exchange rate example with google api, jQuery referesh div without reloading page, jQuery delete row from gridview and database in asp.net, jQuery check if string contains specific text or not and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to add items to an array if not exists in array with example in jQuery.
In previous articles I explained jQuery currency exchange rate example with google api, jQuery referesh div without reloading page, jQuery delete row from gridview and database in asp.net, jQuery check if string contains specific text or not and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to add items to an array if not exists in array with example in jQuery.
By using inArray property we can add items to an array if not exists in jQuery
for that we need to write the code like as shown below
|
If
you want to check it in complete example you need to write the code like as
shown below
|
Live
Demo
For
live demo try to enter same country names in textbox and click button to check
whether item exist in array list or not to insert into array list
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.