jQuery – All Selector (“*”) – Universal Selector

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 or link 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 !!

Was this post helpful?

Join 8000+ Awesome Developers, Like YOU!

Leave a Comment

About HowToDoInJava

This blog provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions, and frequently asked interview questions.

Our Blogs

REST API Tutorial