Skip to content

Updating elements

Course: Basics of DOM - chapter 5

  • .innerHTML - Used for updating the HTML inside an element
  • .textContent - Used for updating the text content inside an element

Assignment - Update the first todo’s contents

Section titled “Assignment - Update the first todo’s contents”

const firstTodo = document.querySelector("h4");
firstTodo.innerHTML = "Dont' take class"