OUTPUT
Sunday, June 27, 2010
Changing Background colour
<html><head><script language="javascript">var backcolor=new Array();backcolor[0]='#ff0000';backcolor[1]='#00ff00';backcolor[2]='#0000ff';backcolor[3]='#ffffff';backcolor[4]='#000000';backcolor[5]='#ffff00';backcolor[6]='ivory';function changeBG(whichColor){document.bgColor=backcolor[whichColor];}</script></head><body>Select backgroundcolor<select id="select1" style="width:171px"><option selected="selected" value="0">red</option><option value=1>green</option><option value=2>blue</option><option value=3>white</option><option value=4>black</option><option value=5>yellow</option><option value=6>ivory</option></select><p><input id="button1"type="button" value="setbackgroundcolor" onclick="changeBG(select1.value);"></p></body></html>
OUTPUT
OUTPUT
0 comments:
Post a Comment