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): 43488/ 209

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

User Comments

Title: good   
Name: 00
Date: 2010-01-28 10:44:36 PM
Comment:
thanks
Title: Request   
Name: Pls write more article on JQuery
Date: 2009-05-12 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: 2009-05-11 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: 2009-05-11 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-2019 ASPAlliance.com  |  Page Processed at 2019-05-26 11:26:13 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search