Wednesday 28 December 2011

Example in JavaScript - background effects in color

Example: JavaScript  Background Effects in color

<html>
<head>
<title>JavaScript  BG Effects in color</title>

<script language="javascript">
<!-- Begin
function test(form) {
if (form.text.value == "")
alert("What\'s your favorite color?")
else {
document.bgColor=(""+form.text.value+"");
}
}
// End -->
</script>
</head>
<body vlink="#fff" bgcolor="maroon">

<center>
<table width="600" cellspacing="10" cellpadding="0">
<tbody>
<tr>
</tbody>
</table>
<br>
<br>
<basefont size="3"></basefont>
<font size="6">

<br>
<br>
</font>
<table width="486" cellspacing="0" cellpadding="3" border="0">
<tbody>
</table>
<center>
<form>
<b>
Please enter your favorite
<br>
color and then click the button.
<br>
<input type="text" name="text">
<input type="button" onClick="test(form)" value="click for color!" name="button">
</b>
</form>
</center>
<b>
<p> </p>
<p>

</b>
</body>
</html>

No comments:

Post a Comment