×

Html & Html5

it training classes Logo

The World's best Software Development Study Portal

Javascript innerHTML Property



The JavaScript innerHTML property is used to generate the dynamic html and is the easiest way to modify the content of an HTML element. The dynamic HTML can be a registration form, comment form, links etc.

<script>

function Deepak() {

var data="Name:<br><input type='text' name='name'><br>Message:<br><textarea rows='5' cols='50'></textarea><br><input type='submit' value='Submit'>"; document.getElementById('mylocation').innerHTML=data;

}

</script>

<form name="myForm">

<input type="button" value="Deepak" onclick="Deepak()">

<div id="mylocation"></div>

</form>


Output







JS training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute