1
2
3
4
5
6
7
8
9
|
<html>
<head> <title>t1</title>
<script type="text/javascript">
function addNode() { var newP = document.createElement("p");
var textNode = document.createTextNode(" This is a new text node");
newP.appendChild(textNode); document.getElementById("firstP").appendChild(newP); }
</script> </head>
<body> <p id="firstP">firstP<p> </body>
</html>
|
Thursday, May 18, 2017
Show the code for adding new elements dynamically?

Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment