73 Different examples of JQuery Selectors for Web Developers and Designers: Hi Friends, Today I will tell you about different selectors of jquery. Generally we are confused sometime how to select the document elements using jquery, so here is the list with brief explanation.
If you are new in jquery, all the selectors are useful for you. For experienced person most of them are new.
Anyone can use it according to your requirement.
All document elements.
The document element with id=”hello”
All document elements with class=”info”
All document elements with class=” info”, and the document element with id=” hello”
All <h1> document elements.
All <h1> document elements and all <p> document elements.
All <button> elements and all <p> document elements.
All id=”hello” elements inside class=”info” elements.
All class=”info” elements inside id=”hello” elements.
All hovered elements.
All active link elements.
All visited Links.
All span elements.
All span element inside div elements.
All even elements.
All odd elements.
All lang attributes.
All elements that are the only child of their parent.
The first <p> document element.
The last <p> document element.
All even <tr> document elements.
All odd <tr> document elements.
All <p> document elements that are the first child of their parent.
All <p> document elements that are the first <p> element of their parent.
All <p> document elements that are the last child of their parent.
All <p> document elements that are the last <p> element of their parent.
All <li> document elements that are the first child of their parent.
All <li> document elements that are the last first child of their parent.
All <li> document elements that are the second <li> element of their parent.
All <li> document elements that are the second last <li> element of their parent.
All <b> document elements that are the only child of their parent.
All <h3> elements that are the only child of its type, of their parent.
All <p> document elements that are a direct child of a <div> element.
All <p> document elements that are descendants of a <div> element.
The <h3> document element that are next to each <ul> elements.
All <table> document elements that are siblings of a <ul> element.
The first <li> element of <ul> elements (index starts at 0).
All <li> elements of <ul> elements with an index greater than 0.
All <li> elements of <ul> elements with an index less than 3.
All header elements <h1>, <h2>
All header elements that are not <h1> elements.
All animated elements
The element that currently has focus.
All document elements which contains the text ” Hello World “
All <div> elements that have a <p> element.
All empty elements (like <input />)
All elements that are a parent of another element.
All hidden <p> elements
All visible tables.
The document’s root element.
All <p> document elements with a data attribute value starting with “he”
All document elements with an id attribute.
All document elements with an id attribute value equal to “email-me”.
All <p> elements without an id attribute value equal to “email-me”.
Note: Also <p> document elements with no id attribute at all.
All document elements with an id attribute value ending with “etu”
All document elements with an id attribute value equal to “ema” or starting with “ema” followed by a hyphen (-)
All document elements with an id attribute value starting with the letter “A”
All document elements with a title attribute value containing the word “task”
All document elements with an id attribute value containing the string “r”
All form elements.
All form elements with type=”text”
All form elements with type=”password”
All form elements with type=”radio”
All form elements with type=”checkbox”
All form elements with type=”submit”
All form elements with type=”reset”
All form elements with type=”button”, and all <button> document elements.
All form elements with type=”image”
All form elements with type=”file”
All enabled form elements.
All disabled form elements.
All selected options in a drop-down list or a form.
All checked form elements.
Read About Other Interesting Things about jquery below.
I hope you will like 73 Different Examples of JQuery Selectors for Web Developers and Designers. If You found it useful please subscribe my blog.
Categories: Website Design
Leave a Reply