HTML and CSS Reference
FIGURE 1-22 Converting all the <p> elements to <a> elements
All your plain-text paragraphs now display as hyperlinks. Your original innerDiv element is
would need to hang on to that reference if you intended to swap it back into the DOM later.
Further, because the code didn't assign the new <div> element a unique id , the only way
to get a reference to it in the DOM is through your existing code reference. For this reason,
variables go out of scope before you insert them into the document, you lose the references
to your elements completely.
the DOM in the browser. You now can retrieve references to the elements or nodes that make
up your HTML document as well as modify, add, and remove elements in the HTML document.
Next, you look at implementing media controls into your pages.
Embedding multimedia elements into webpages isn't a new concept. This capability has been
around for a long time and has presented challenges in various situations. One key challenge
has often been dependence on a third-party object integrated with the browser to render the
media. In this section, you look at two new elements added to the HTML5 specification that
<video> and <audio> elements.