Exploring jQuery Selectors
page 5 of 11
by Nihar Ranjan Nayak
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 10301/ 234

Content Filters

:contains(text)

Finds all elements which contain the given text.

                        $("div:contains('John')")

The above code will find all the DIVs which contains the word 'John'. The argument passed inside contains() is string type and case sensitive.

:empty

Matches all elements that have no children (including text nodes).

                   $("td:empty")

This code will find all the Tds which doesn't have any value or are empty.

:has(selector)

Matches elements which contain at least one element that matches the specified selector.

                        $("div:has(p)")

The above code will match the DIV elements which have a paragraph (p element) inside them. The attribute selector is a selector with which we want to filter by.

:parent

This finds all elements that are parents i.e. they have child elements, including text.

                        $("td:parent")

Finds all tds which have other child control, including text, inside them.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 6 and type the answer here:

User Comments

Title: Request   
Name: Pls write more article on JQuery
Date: 5/12/2009 6:46:55 AM
Comment:
Hello Nihar
Please write more articles on JQuery.
Tume lekha ame sahajare khali padhi kam akribu
How is the IDEA?
Excellent Idea...
Title: Ureka   
Name: Lulu
Date: 5/11/2009 10:26:46 AM
Comment:
Really I have been searching this type of article for last 2 months.Thank you Nihar.
Title: Excellent boss   
Name: Sumoon
Date: 5/11/2009 10:23:15 AM
Comment:
Excellent Article boos.Please post tghis type of usefull articles more

Product Spotlight
Product Spotlight 






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 11/22/2009 4:57:08 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search