<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>
struct Node *ptr = (struct Node*) malloc (sizeof (struct Node))
//node structure
class Node {
public int data;
public Node next;
};
class LinkedList {
public Node head;
//constructor to create an empty LinkedList
public LinkedList(){
head = null;
}
};