Get Started with the DOM in JavaScript

Let's discover DOM objects properties and methods that you can manipulate with JavaScript.

Access the DOM with the document variable

When a JavaScript program runs in the context of a web browser, it can access the root of the DOM using the variable document. This variable matches the <html> element. document is an object that has head and body properties which allow access to the <head> and <body> elements of the page.

Get hands-on with 1400+ tech skills courses.