August 2013
Beginner
70 pages
1h 26m
English
In this recipe, you'll learn how to select elements by their tag name using what is known as element selector. The goal of this task is to show you how to select and hide the paragraphs in the page.
To achieve our goal, perform the following the steps:
template.html file and rename it as selecting-by-tag-names.html.<body> tag, add the following HTML markup:<h1>The Tag name selector</h1>
<div>
This example shows you how to use a tag name.
<p>After you'll click the button below, both the paragraph of this page will be hidden.</p>
<p>I'm yet another paragraph</p>
</div>
<button id="hide-button">Hide elements!</button><head> section of the page adding this code:<script> ...
Read now
Unlock full access