jQuery Selectors Freejquery


jQuery selectors enable you to choose and manipulate the HTML element(s).

jQuery selectors are used to “find” (or select) HTML elements which is based on their, id, classes, types, attributes, values of attributes and much more. It depends on the existing CSS Selectors, and in addition, it has some own custom selectors.

The jQuery library harnesses the power of Cascading Style Sheets (CSS) selectors to let us quickly and easily access elements or groups of elements in the Document Object Model (DOM).

A jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria. Simply you can say, selectors are used to select one or more HTML elements using jQuery. O

The Element Selector

Select all <p> elements on a page

[symple_ul style=”minus-blue-list”] [symple_li]$(“p”)[/symple_li] [symple_li]Your content here …[/symple_li] [/symple_ul]

Try This Exercise Click Here

The #id Selector

The jQuery #id selector mostly used the arrtribute consist of HTML Tag.

Follow this HTML Tag to Find.

[symple_ul style=”minus-blue-list”] [symple_li]$(“#test”)[/symple_li] [symple_li]Your content here …[/symple_li] [/symple_ul]

Try This Exercise Click Here

The .class Selector

The jQuery .class selector finds elements with a specific class using any tag

To find elements with a specific class, write a period character, followed by the name of the class:

[symple_ul style=”minus-blue-list”] [symple_li]$(“.test”)[/symple_li] [symple_li]Your content here …[/symple_li] [/symple_ul]
Try This Exercise Click Here
You can find more than 10+ selectors jQuery 
Note: The all, or universal, selector is extremely slow in running, except when used by itself
 Examples: Find every element (including head, body, etc) in the document.

 

Leave a Reply

Your email address will not be published. Required fields are marked *