Cominciamo dall'oggetto Document.
Ecco, ho usato getElementById per arrivare a un DIV che ha un certo Id:
<html>
<head>
<script>
function funzione(){
document.getElementById("primo").style.backgroundColor="red"
}
</script>
</head>
<body>
<div id="primo" onClick="funzione()">Ciao bestiolina</div>
</body>
</html>
Nessun commento:
Posta un commento