jQuery All Selector (“*”)

The jQuery all selector selects every element of the HTML page. If you want to apply color to all the elements of a document. The jQuery all (“*”) selector is the best way to perform this task. It first, find every element of the document and then after applies the color to all the elements.

Let’s find out how to write it in jQuery using the syntax which is given below.

Syntax

Example

Test it Live

The above example applies the color to all the elements of the DOM using jQuery.

There are many elements in an HTML document. The jQuery all selector selects all the elements including the <html>, <head> and <body> tag elements. It’s an easy way to apply the jQuery script to all the elements with a single specification.

You may also like to read

To learn more jQuery, you can read our step-by-step jQuery Tutorial Guide for beginners.

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.