- jQuery Examples
- Examples - Home
- Examples - Set up
- Examples - Selectors
- Examples - Attributes
- Examples - Traversing
- Examples - CSS
- Examples - DOM
- Examples - Events
- jQuery Useful Resources
- jQuery - Quick Guide
- jQuery - Useful Resources
jQuery Selectors - Examples
Learn how to play with selectors in jQuery. Here are most commonly used examples −
How to select all elements that are children of a paragraph element?
How to get all the elements that have the class of specialClass?
How to select all elements matched by <li> that do not have class="myclass"?
How to match links with an id of specialID and a class of specialClass?
How to match links with a class of specialClass declared within <p> elements?
How to select all elements matched by <ul> that are children of an element matched by <li>?
How to select all elements matched by <ul> that follow a sibling element matched by <p>?
How to select all elements matched by <code> or <em> or <strong>?
How to select all elements matched by <p> that have no children?
How to select all elements matched by <div> that contain an element matched by <p>?
How to select all elements matched by <p> that contain an element with a class of myclass?
How to select all elements matched by <a> that have a rel attribute?
How to select all elements matched by <input> that have a name value exactly equal to myname?
How to select all elements matched by <input> that have a name value beginning with myname?
How to select all elements matched by <a> that have rel attribute value ending with self?
How to select all elements matched by <a> that have an href value containing domain.com?
How to select all elements matched by <li> that have an even index value?
How to select all elements matched by <tr> that have an odd index value?
How to select all elements matched by <li> that are visible?
How to select only form elements (input, select, textarea, button)?
How to select all elements matched by <li> after the second one?
How to select all elements matched by <p> after the third one?
How to select all elements matched by <li> that are the first child of their parent?
How to select all elements matched by <li> that are the last child of their parent?
How to select all elements that are the parent of another element, including text?
How to select all elements matched by <li> that contain the text second?