Monday, January 13, 2014

innerHTML example.

<html>
<body>
<script type="text/javascript" >
function commentForm()
{
var data="Name:<input type='text' name='name'><br>Comment:<textarea rows='5' cols='50'></textarea><br><input type='submit' value='comment'>";
 
document.getElementById('place').innerHTML=data;
}
</script>
<form name="myForm">
<input type="button" value="comment" onclick="commentForm()">
<div id="place"></div>
</form>
</body>
</html>

No comments:

Post a Comment