The jQuery element selector selects elements based on the element name.
You can select all <p> elements on a page like this.
The jQuery #id selector uses the id attribute of an HTML tag to find the specific element.
When a user clicks on a button, the elements with class="test" will be hidden.
When a user clicks on a button, the paragraph elements with the assigned class will be hidden.
Select all elements with class "intro", "demo" or "end".
When a user clicks on a button, all elements will be hidden.
Select all <h2>, <div> and <span> elements.
When a user clicks on a button, the element with the focus, the button, will be hidden.
Programmable event occurs upon receiving focus.
When a user clicks on a button, the first paragraph element will be hidden.
When a user clicks on a button, the first list element of the first unordered list will be hidden.
Selects the first <li> child element of each <ul>
When a user clicks on a button, the first list element of each unordered list will be hidden.
Selects every <p> element that is the last child of its parent
Select each <p> element that is the only child of its parent
Selects all <p> elements that are the first <p> element of their parent
Selects every <p> element that is the last <p> element of its parent
Selects all <p> elements that are the only <p> element of their parent
Select each <p> element that is the third <p> element of its parent
Select each <p> element that is the third <p> element of its parent, counting from the last child
Selects every <p> element that is the third child of its parent
Selects every <p> element that is the third child of its parent, counting from the last child
When a user clicks on a button, all elements with an href attribute will be hidden.
Select all <span> elements that are a direct child of a <div> element. They will appear with a yellow background.
Select all <span> elements that are descendants of a <div> element. They will appear with a yellow background.
Select all <p> elements that are next to and following each <div> element. They will appear with a yellow background.
Select all <p> elements that are siblings and appear after the <div> element. They will appear with a yellow background.
Select all header elements (h1 to h6).
Select any element that is currently animated.
Select all <p> elements containing "is".
Select all <p> elements that have a <span> element inside of them.
Select all empty elements.
Show hidden <p> elements.
Select all visible <p> elements.
Set the background color for the HTML document to yellow.
Select and style every <p> element with a lang attribute value equal to "it" (Italian).
Select every element containing an id attribute with the value "choose".
Select every paragraph element without a class attribute of "intro".
Select all <a> elements with a href attribute that ends with ".org".
Select all <p> elements with a title attribute that starts with the value "Tomorrow".
Select all <input> elements with a name attribute that starts with the value "nation".
Select all <input> elements with a name attribute that contains the specific word "nation".
Select all <input> elements with a name attribute that contains the word "nation".
The :input selector selects form elements.
This selector also works with the button element.
The :text selector selects input elements with type=text.
The :text selector selects input elements with type=password.
The :text selector selects input elements with type=radio.
The :checkbox selector selects input elements with type=checkbox.
Select all checked elements (checkboxes or radio buttons).
The :submit selector selects button and input elements with type=submit.
The :reset selector selects button and input elements with type=reset.
The :button selector selects button and input elements with type=button.
The :image selector selects input elements with type=image.
The :file selector selects input elements with type=file.
The :enabled selector selects all enabled form elements.
The :disabled selector selects all disabled form elements.
Select the pre-selected item(s) in a drop-down list.
Select all <td> elements with children, including text.
When a user clicks on a button, all anchor elements with a blank target attribute will be hidden.
When a user clicks on a button, all anchor elements with a non-blank target attribute will be hidden.
All even table rows will be highlighted yellow.
All odd table rows will be highlighted yellow.