Far partire script in automatico?
Salve, ho uno script che cambia colore al testo, ma accade solamente se ci si passa il mouse sopra [naturalmente se lo si toglie da sopra rimane sempre lo script attivo], ma io vorrei che si attivasse anche se non si passa il mouse su quel testo, come faccio? Questo è il codice della pagina in cui c'è lo script:
Codice:
<html>
<head>
<title>RBL ~ Invia una richiesta</title>
<style type="text/css">
body {
background-color: black;
}
.button {
background-image: url(button.png);
width: 89px;
height: 39px;
text-align: center;
}
.buttontext {
font-size: 16px;
font-weight: bold;
padding-top: 7px;
background: transparent;
border: 0px;
text-decoration: none;
color: black;
}
.buttontext:hover {
color: white;
}
</style>
<script src="rainbow.js"></script>
</head>
<body>
<font color="red"><h2 onmouseover="doRainbow(this);" onmouseout="doRainbow(this);">Invia una richiesta</h2></font><br>
<font color="white"><form method="POST" action="request.php">
<b><strong>Inserisci il tuo nickname<br>
<input type="text" name="nickname"><br><br>
Cosa desideri inviare?<br><br>
<input type="radio" name="request" value="Richiesta canzone" onclick="document.getElementById('show').style.display='block'; document.getElementById('show2').style.display='none'; document.getElementById('show3').style.display='none';" />Richiedi una canzone [Canzone]<br>
<input type="radio" name="request" value="Dedica" onclick="document.getElementById('show2').style.display='block'; document.getElementById('show').style.display='none'; document.getElementById('show3').style.display='none';" />Invia una dedica [Canzone + Dedica]<br>
<input type="radio" name="request" value="Messaggio" onclick="document.getElementById('show3').style.display='block'; document.getElementById('show').style.display='none'; document.getElementById('show2').style.display='none';" />Invia un messaggio [Messaggio]<br><br>
<div id="show" style="display: none;">
Inserisci il nome del brano<br>
<input type="text" name="brano"><br><br>
Inserisci il/la cantante/gruppo<br>
<input type="text" name="cantante"><br><br></div>
<div id="show2" style="display: none;">
Inserisci il nome del brano<br>
<input type="text" name="brano"><br><br>
Inserisci il/la cantante/gruppo<br>
<input type="text" name="cantante"><br><br>
A chi desideri dedicare questa canzone?<br>
<input type="text" name="dedica"><br><br>
</div>
<div id="show3" style="display: none;">
Inserisci il messaggio<br>
<textarea name="messaggio" cols="30" rows="8" maxlengh="500"></textarea><br><br></div>
<div class="button"><input type="submit" class="buttontext" value="Invia"></div>
</form></strong></b></font>
</body>
</html>