Qui trovi tutto sull'argomento http://javascript.html.it/guide/lezione/813/i-nodi/