jQuery Selectors: Universal selector *

We first look at the universal selector * where it selects all HTML elements.

The <h4>, <p> and <a>  were all selected using *.

<!DOCTYPE html>
<html>
<head>
    <script src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>
    <script>
        $(function () {
            $('*').css('color','blue');
        });
    </script>
</head>
<body>
<h4>Ushuaia</h4>
<p>Southernmost city in the world.</p>
<a href='http://en.wikipedia.org/wiki/Ushuaia'>Visit us here.</a>
</body>
</html>

Series Navigation<< jQuery Selectors: Introduction
jQuery Selectors: Selecting elements based on tags >>