0 votes
in JavaScript by
How to write HTML code dynamically using JavaScript?

1 Answer

0 votes
by

The innerHTML property is used to write the HTML code using JavaScript dynamically. Let's see a simple example:

  1. document.getElementById('mylocation').innerHTML="<h2>This is heading using JavaScript</h2>";  
...