You are on page 1of 1

<html>

<head>
<title>Dynamic Style Demo</title>
<script type="text/javascript">
function display(color_name)
{
document.body.style.backgroundColor=color_name;
}
</script>
</head>
<body>
<form name="form1">
<b>Enter some color name here:</b><br>
<input type="text"name="text1"><br><br><br>
<input type="button"name="button1"value="click here to change backgroundcolor"
onclick="display(form1.text1.value)">
</body>
</html>

You might also like