si usano quindi tutti i metodi dell'array:
esempio: individua gli aelementi e ne cambia il colore in base ad un array
colore = new Array("red","orange","green");
function colore_celle()
{
if(document.getElementById && document.getElementsByTagName) per cross-browsing}
{celle = document.getElementById("r3").getElementsByTagName("td");}
for(i=0; i < celle.length; i++)
celle.item(i).style.color = colore[i];
esempio:
function inserisci_immagine(){
if(document.getElementById && document.createElement){immagine = document.createElement("IMG");}
immagine.setAttribute("src","Logo.gif");
immagine.setAttribute("alt","Esempio");
document.getElementById("par_pre").appendChild(immagine);}
esempio:
function inserisci_frase(){
if(document.getElementById && document.createTextNode){frase = document.createTextNode("Iniziamo con un esempio semplice");}
document.getElementById("par_pre").appendChild(frase);}
restituisce il nome del tag dell'elemento associato
elemento_recuperato.tagName