From the course: jQuery Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Advanced filters

Advanced filters - jQuery Tutorial

From the course: jQuery Essential Training

Start my 1-month free trial

Advanced filters

- [Instructor] Let's wrap up our investigation of advanced filters by considering the child and content filters. So, in your Code Editor open up ChildVisCont underscore start in the Editor. Content filters let you filter the results of jQuery selectors by examining the content of the selectors themselves. So, for the first example, I'll use the contains filter. So, I'll write the selector to look for paragraph tags and then use the css trick that we've been using. So I'm going to add the contains filter and I'll write colon contains and then the string three. In this example, my code selects paragraph tags and it's using the contains filter to select paragraph tags that contain this text string which happens to be the number three. And, if we scroll down into the document content, you'll notice this paragraph here has the number three in it. So, this paragraph should have a bold red border applied to it when we run this code. So, let's save and I'll bring this up in the browser and…

Contents