All ('*')S2C Home « Selectors « All ('*')

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 ('*') Examplego to top of page 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:


go to home page Homepage go to top of page Top