Latest Tutorials

Displaying child nodes of the document's body

<!DOCTYPE html> <html> <body> <p> Click button to get chi...

Example of appendChild() method - adding a child node

<!DOCTYPE html> <html> <body> <script> function appendHe...

Example of cloneNode() method - cloning a node

<!DOCTYPE html> <html> <body> <ul id="list1">&...

Example of insertBefore() method - inserting a node

<!DOCTYPE html> <html> <body> <ul id="list1">&...

Example of removeChild() method - removing a child node

<!DOCTYPE html> <html> <body> <ul id="list1">&...

Example of replaceChild() method - replacing a child node

<!DOCTYPE html> <html> <body> <ul id="list1">&...

Example of hasChildNodes() method - checking for existance of a child node

<!DOCTYPE html> <html> <body> <ul id="list1"&g...

Example of document.writeIn() method

<!DOCTYPE html> <html> <body> <script> document.writel...

Opening, closing and writing to a document

<!DOCTYPE html> <html> <body> <button onclick="docO...

Example of getElementsByTagName() method - reading the elements by tag

<!DOCTYPE html> <html> <body> <ul><li>Car</l...