Use of bgcolor to new window !!
<html>
<head>
<title>Colors!!</title>
<script language=javascript>
function NewWindow() {
new_win = window.open("","defaultwindow","toolbar=yes,resizable=yes");
cindex=document.form1.cbocolor.selectedIndex;
color = document.form1.cbocolor.options(cindex).text;
new_win.document.write("<html><body bgcolor="+color+">Color changed successfully!!</body></html>");
}
</script>
</head>
<body>
<center>
<strong>Use of bgcolor to new window !!</strong>
<hr>
<form name=form1>
Choose the bgcolor:
<select name=cbocolor>
<option name=blue>Blue </option>
<option name=green>Green</option>
<option name=pink>Pink</option>
<option name=black>Black</option>
<option>Yellow</option>
</select> <br>
<br>
<input type=button name=cmdok value=" OK " onClick="NewWindow()">
</form>
</center>
</body>
</html>
No comments:
Post a Comment