Document Object Model

Everything I have discussed in this chapter up to this point has been part of the JavaScript language. However, one of the most important parts of working with JavaScript is in interacting with web pages. This occurs through an application programming interface (API) that browsers provide which allows you programmatic access to the content on a web page. At its heart, the document object model (DOM) provides a structural representation of the web page, which allows you, as a programmer, to write scripts to modify the content and visual representation of the information in a programmatic way.

It is worth pointing out that the DOM specification is implemented in slightly different ways by the different browser vendors with ...

Get Beginning Facebook Game Apps Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.