August 2013
Beginner
70 pages
1h 26m
English
In this recipe we'll see how to select a collection of elements using the Class selector. Our goal is to hide all of the elements having the class red.
To achieve the prefixed objective, we need to perform the following steps:
template.html file and rename it as selecting-by-class.html.<body> tag, add the following HTML markup:<h1 id="title" class="bold red">The Class selector</h1> <div id="container"> This example shows you how to use the Class selector. <p id="description" class="red">After you'll click the button below, the h1 and this p will be hidden.</p> <p id="note" class="green">This happens because of their class attribute's value.</p> </div> <button id="hide-button">Hide ...
Read now
Unlock full access