Answers for "how to change the text content of an html element in javascript"

1

set text of dom element

document.getElementById("myBtn").textContent = 'Hello World';
Posted by: Guest on March-05-2020
0

javascript element edit text

// example:
document.querySelector(`.message`).textContent = `New Message`;

// syntax:
// document.querySelector(`.<class-name>`).textContent = `<new-value>`;
Posted by: Guest on December-08-2020

Code answers related to "how to change the text content of an html element in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language