Solved

jQuery indexOf with list filtering

Posted on 2014-04-03
2
315 Views
Last Modified: 2014-04-07
I have a couple of cases in my jQuery code where I am going through a list but finding an element using indexOf.

One is looking for drop down lists ("select" elements) where the id contains a string, and the other is items in a drop down list (the "option" elements) where the value contains a string.

Is there a way to use the indexOf as part of the each expression?
0
Comment
Question by:purplesoup
2 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 39975718
Hi
can you pl share any code sample ?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39976283
Use jQuery.filter : http://api.jquery.com/filter/
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question