Skip to main content
D
JavaScript
JavaScript HTML DOM Methods

JavaScript HTML DOM Methods

JavaScript DOM methods target and manipulate HTML elements.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript provides built-in methods to interact with the DOM tree. Developers use these methods to grab specific HTML tags by their ID or class name, and then change their content or styling without needing to reload the page.

Example

Example
1/* this uses DOM methods */
2let title = document.getElementById("header");
3title.innerHTML = "New Welcome Message";
4title.style.color = "blue";

Key Points

  • `getElementById()` finds a single unique element.
  • `querySelector()` finds elements using CSS selectors.
  • The `innerHTML` property changes the HTML content inside.
  • The `style` property applies inline CSS changes.

Up Next

Continue your journey with the next topic.

Go to JS DOM Events