www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons jQuery Selectors Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
It is very common to read and modify the content of a web page, when working with jQuery. To do this, we need to, first, find the element(s) that we wish to work with. Selector support in jQuery helps us in finding the elements.

Normally in JavaScript, finding elements is extremely cumbersome, unless we need to find a single element having a value specified in the ID attribute.

jQuery helps us find elements based on their IDs, classes, types, attributes, values of attributes and more. Finding elements in jQuery is based on CSS selectors and is very powerful.

As this is a very common task, the jQuery provides several constructors take a selector query as an argument, allowing us to locate element(s) with a very concise piece of for optimal efficiency. You instantiate the jQuery object simply by writing jQuery() or using the $().

The syntax for using a jQuery constructor to find DOM element(s) is as under:

jQuery(<selector query);

We may also write the above line of code as under:

$(<selector query >);

The above jQuery constructor would return a jQuery object depending upon the selector query we pass to it. We can then use that object to work with the element(s) that were matched.

Next >>> Lesson No. 7: jQuery Selectors 2





Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.