The innerHTML property is used to write the HTML code using JavaScript dynamically. Let’s see a simple example:
document.getElementById('mylocation').innerHTML="<h2>This is heading using JavaScript</h2>";
The innerHTML property is used to write the HTML code using JavaScript dynamically. Let’s see a simple example:
document.getElementById('mylocation').innerHTML="<h2>This is heading using JavaScript</h2>";