<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Documento senza titolo</title> </head> <script language="javascript" type "text/javascript">; function cambiacolore(colore) { switch(colore) { case "rosso" : colore="#ff000"; break; case "blu" : colore="#000ff"; break; } document.getElementById("prova").style.backgroundColor=colore; } </script> <body bgcolor="yellow"> <div id="prova" style="height:280px;width280px;background-color:black;"> </div> <a href="#" onClick="javascript: cambiacolore(rosso);">rosso</a> <a href="#" onClick="javascript: cambiacolore(blu);">blu</a> </body> </html>
<a href="#" onClick="javascript:cambiacolore('rosso');">rosso</a>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Documento senza titolo</title> </head> <script language="javascript" type "text/javascript">; function entra() { nickname= new Array("marco","gigi","christian"); document.getElementById("prova")=i; if (i=nickname) { location.reload('http://www.hacksmobile.altervista.org'); } else { alert('Non sei abilitato per procedere.'); } } </script> <label>Inserisci il tuo nickname se sei abilitato: <input type="text" name="accesso"> <form id="prova" target=”_blank”> <input id="prova" type="button" value="Clicca qui" onclick="javascript:entra()"> </form> </label> </body> </html>
document.getElementById("prova")=i;
<script language="javascript" type "text/javascript">;