Question/Color Button

Script by Dennis Wildbore

     This is really a slick little program. Hopefully you've clicked the button, answered the questions, and gotten a new color. The program uses what the person writes to create the background color. If the person puts in a word that isn't a color, the browser simply ignores the commands and the original background is used. You can change out the VALUE so the button reads something different, too. Here's the script:

<FORM>
<input type="button" value="Click here"
onClick="var hh = prompt('enter your name','');
var gg = prompt('enter a color','');
alert('hello ' +hh+ ' you picked ' +gg+ ' !');
document.bgColor=gg">
</FORM>

Back to the Button, Links, and E-Mail Scripts