The jQuery hierarchy selectors are used to select
elements from a page based on their position and relationship with their parent
elements. For example the [input[type=text]:first] selector
will select the first textbox element in the page
In this post we shall see the various hierarchy selectors available in jQuery, and how to use them to filter out elements.
The following are the hierarchy selectors available in jQuery.
In this post we shall see the various hierarchy selectors available in jQuery, and how to use them to filter out elements.
The following are the hierarchy selectors available in jQuery.
Selector
|
Element
selected
|
:first
|
First
element in the page
|
:last
|
Last
element in the page
|
:even
|
All
event elements in the page
|
:odd
|
All odd
elements in the page
|
:only-child
|
Elements which are the only child for their immediate parent
|
.parent
|
Parent of the element
|
:nth-child(x)
|
Child element in the position x
|
:empty
|
Elements which do not have child elements
|
input[type=text]:first
|
First TextBox in the page
|
input[type=text]:last
|
Last TextBox in the page
|
select:first
|
First Drop Down in the page
|
select:last
|
Last Drop Down in the page
|
Related Post
jQuery hierarchy selector
jQuery first selector
jQuery last selector
jQuery even selector
jQuery odd selector
jQuery only-child selector
jQuery parent selector
jQuery nth-child selector
jQuery index :gt selector
jQuery empty selector
jQuery first selector for Textbox
jQuery last selector for Textbox
jQuery first selector for Dropdown
jQuery last selector for Dropdown
jQuery hierarchy selector Example
jQuery hierarchy selector
jQuery first selector
jQuery last selector
jQuery even selector
jQuery odd selector
jQuery only-child selector
jQuery parent selector
jQuery nth-child selector
jQuery index :gt selector
jQuery empty selector
jQuery first selector for Textbox
jQuery last selector for Textbox
jQuery first selector for Dropdown
jQuery last selector for Dropdown
jQuery hierarchy selector Example
No comments:
Post a Comment