JavaScript Change the Text of a Div Element using JavaScript December 23, 2022 / December 23, 2022 by Philip Newman | Leave a Comment Use the textContent property to change the text of a div element, e.g. div.textContent = 'Replacement text'. The textContent property will set the text of the div to the provided string, replacing any of the existing content. Here is the HTML for the examples in this article. index.html And here is the related JavaScript code. index.js We used the textContent property on the div to change its text […] Read more ยป HTML5 JavaScript