All Selector ('*') JQ Home  <<  Selectors  <<  All Selector ('*')

Universal selector.

Shorthand version $('*')

Description

The ('*') selector allows us to select all elements.

Syntax

Signature Description
jQuery('*')Select all elements.

Parameters

None.

Return

N/A.

All Selector ('*') Example Selectors  <<  Top

Select all elements.

The following example will select every element on the page and change the visible text to indigo.




$(function(){
  $('#btn1').on('click', function() {
    $('*').css('color', 'indigo');
  });
}); 


Press the button below to action the above code:

Related Tutorials

jQuery Basic Tutorials - Lesson 3 - CSS Selectors