Tutorialsplane

jQuery Selectors


jQuery Selectors are used to select the element. jQuery selectors play an important role in jQuery library.

JQuery Selectors

jQuery Seletors are based on such as : Name, Id, Classes and many more…

The very basic selector(Name) example :

jQuery Selctors Example :




<title>jQuery Selectors Example</title>
 
 
  
	

<div> 
This id test div one .....and background is added using jquery...
</div>
<br/>
<div> 
This id test div two.....and background is added using jquery...
</div>


                              

Try it »

Main jQuery Selectors

[table width=”100%” colwidth=”20|100|50″ colalign=”left|left|center|left|right”]
No,Selector
1, Name : The example of name tag are

<p> </p><div>
<p>2, <strong>Class</strong> :The example of class selector is – </p>
<pre><div class="test"></div>

Here class selector is “test”.
3, ID : The example of ID selector is –

<div id="MainDiv"></div>

Here class selector is “MainDiv”
[/table]

More jQuery Selectors

[table width=”100%” colwidth=”20|100|50″ colalign=”left|left|center|left|right”]
No,Selector,Example
1, $(“*”) : Selects all elements in the page. , See Detail & Demo »
2, $(this) :Selects current element.,See Detail & Demo »
3, $(“p.myclass”) : Selects all <p> which have class “myclass”.,See Detail & Demo »
4, $(“ol li:first”) : Selects first <li> element of the <ol>,See Detail & Demo »
5, $(“ol li:last”) : Selects last <li> element of the <ol>,See Detail & Demo »
6, $(“[href]”) : Selects all elements with “href” attributes.,See Detail & Demo »
7, $(“tr : even”) : Selects all even tr elements of the table.,See Detail & Demo »
8, $(“tr : odd”) : Selects all odd tr elements of the table.,See Detail & Demo »
[/table]

Jquery Tutorial

jQuery Effects

jQuery Traversing

jQuery HTML

jQuery Css

jQuery Scroll

jQuery Dimensions

jQuery Ajax