in JavaScript by
Q:
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>";  

Related questions and answers

0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma
0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma
0 votes
asked Mar 20, 2021 in JavaScript by sharadyadav1986
...