DOM Manipulation

Once an element is selected, you can manipulate its properties:

  • element.textContent, element.innerHTML
  • element.setAttribute("attr", value), element.getAttribute("attr")
  • element.style.property = "value"
title.textContent = "Hello World";
title.style.color = "blue";
← PrevNext →