Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

What are nodes?

rsheelerrsheeler Member Posts: 1
Hi, I recently started learning JavaScript and I am trying to learn about "nodes".

What exactly are nodes? What are their functions? From what I can grasp, nodes links elements together or change them.

I've been trying to learn by using w3schools.com js tutorials and the tutorial i'm on right now has the example of this code:

[b]<!DOCTYPE html>



This is a paragraph.

This is another paragraph.




var para=document.createElement("p");
var node=document.createTextNode("This is new.");
para.appendChild(node);

var element=document.getElementById("div1");
element.appendChild(para);



[/b]

With a result of:
[b]This is a paragraph.
This is another paragraph.
This is new.
[/b]


Help would be greatly appreciated!

Comments

Sign In or Register to comment.