25.02.2013 Views

Peter Lubbers - Pro HTML 5 Programming

Pro HTML 5 Programming

Pro HTML 5 Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 1-2. An <strong>HTML</strong>5 page with all the new semantic markup elements<br />

CHAPTER 1 ■ OVERVIEW OF <strong>HTML</strong>5<br />

One last thing to keep in mind is that browsers may seem to render things as if they actually<br />

understand these new elements. The truth is, however, that these elements could have been renamed<br />

foo and bar and then styled, and they would have been rendered the same way (but of course, they<br />

would not have any benefits in search engine optimization). The one exception to this is Internet<br />

Explorer, which requires that elements be part of the DOM. So, if you want to see these elements in IE,<br />

you must programmatically insert them into the DOM and display them as block elements.<br />

Simplifying Selection Using the Selectors API<br />

Along with the new semantic elements, <strong>HTML</strong>5 also introduces new simple ways to find elements in<br />

your page DOM. Table 1-3 shows the previous versions of the document object allowed developers to<br />

make a few calls to find specific elements in the page.<br />

17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!