O'Reilly logo

Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition by Phil Ballard, Michael Moncur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 4. DOM Objects and Built-In Objects

What You’ll Learn in This Hour

• Talking to the user with alert(), prompt(), and confirm()

• Selecting page elements with getElementById()

• Accessing HTML content with innerHTML

• How to use the browser history object

• Reloading or redirecting the page using the location object

• Getting browser information via the navigator object

• Manipulating dates and times with the Date object

• Calculations made easier with the Math object

In Hour 1, “Introducing JavaScript,” we talked a little about the DOM and introduced the top level object in the DOM tree, the window object. We also looked at one of its child objects, document.

In this hour, we introduce some more of the utility objects and methods that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required