The All selector (Must know)
With our template in place, we can start diving into the world of jQuery selectors. A selector is a string that allows you to retrieve DOM's elements. The first selector we'll look at is the
All (or Universal) selector. We'll use it to apply a border to all of the page's elements.
How to do it...
To achieve our goal, perform the following steps:
- Create a copy of the
template.htmlfile and rename it
- Inside the
<body>tag, add the following HTML markup:
<h1>The all selector</h1> <div> This example shows how to use the All selector. <p>As you can see, it doesn't matter we're different tags, we all have the border applied.</p> <span>Every tag has the border, even the body, the html and the head tag!</span> ...