Answers for "create a node js"

0

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>
Posted by: Guest on April-07-2021
0

how to create a node in Java

// This is a template for creating a Node for Singly Linklist in Java
Node{				//This is Node class
	int Num			//This is the data part
  	Node next		//This is the Node type variable which will store the address of next Node type.
}
Posted by: Guest on October-08-2020

Browse Popular Code Answers by Language