August 2013
Beginner
70 pages
1h 26m
English
In this section we'll learn how to select an element by its ID and apply the same border seen previously.
This task can be achieved by performing the following instructions:
template.html file and rename it as selecting-by-id.html.<body> tag, add the following HTML markup:<h1 id="title">The Id selector</h1>
<div id="container">
This example shows you how to use the Id selector.
<p id="description">As you can see, this time the border is applied only to the h1 element because of its id.</p>
<span id="note">Hey, I'm a note</span>
</div><head> section as we did in the previous chapter, but this time add this script after the jQuery library instead:<script> $(document).ready(function() ...
Read now
Unlock full access