JavaScript Tutorial

The language for programming web pages.

JS DOM

JavaScript HTML DOM

The HTML DOM (Document Object Model) is a programming interface for HTML. When a web page is loaded, the browser creates a Document Object Model of the page. JavaScript can change all HTML elements and attributes in the page.

Common DOM Methods:

  • getElementById()
  • getElementsByClassName()
  • querySelector()
  • querySelectorAll()
  • createElement()
  • appendChild()
  • removeChild()
  • innerHTML / textContent

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics