December 2013
Intermediate to advanced
384 pages
9h 54m
English
There are three ways to find HTML elements using JavaScript. You can search for them by the ID attribute name, by the class name, or by the tag type. The following code shows an example of defining an HTML <div> element so that each of these methods can use it:
<div id="myDiv" class="myClass">Content</div>
By adding the ID and class attributes, you can use those values of "myDiv" and "myClass" to search for the <div> element.
Read now
Unlock full access