What should I do if I want to change the string in an H3 tag in JavaScript?
<h3id="test><font color="red">I want to change this character.</font></h3>
document.getElementById("test").innerHTML="<font color='red'>newtext</font>";
If you also add an ID to the font label,
<h3id="test">fontid="test2" color="red">I want to change the character here.</font></h3>
Below:
document.getElementById("test2").textContent="newtext";
© 2024 OneMinuteCode. All rights reserved.