js create element
var newDiv = document.createElement("div");
document.body.appendChild(newDiv);
js create element
var newDiv = document.createElement("div");
document.body.appendChild(newDiv);
create node in javascript
<div id="div1">
<p id="p1">This is a paragraph.</p>
<p id="p2">This is another paragraph.</p>
</div>
<script>
// Create <p> element
var para = document.createElement("p");
// Create a text node
var node = document.createTextNode("This is new.");
// Append text node to <p> element
para.appendChild(node);
// Append <p> to div element
var element = document.getElementById("div1");
element.appendChild(para);
</script>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us