jQuery all ("*")
selector selects all elements in the document, including html, head and body.
Syntax : $("*")
- The all selector is extremely slow so use carefully.
- If your browser has an extension/add-on enabled that inserts a
script
orlink
element into the DOM, that element will be counted as well.
See the Pen jQuery – All Selector by Lokesh (@howtodoinjava) on CodePen.
If the ("*")
selector is used together with another element, it selects all child elements within the specified element.
e.g. Below all selector will select all elements inside #ul
.
Syntax : $("ul *")
See the Pen jQuery – All Selector within element by Lokesh (@howtodoinjava) on CodePen.
Happy Learning !!