Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

What are nodes?

rsheelerrsheeler Posts: 1Member
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.