..or like this
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function change()
{
switch (document.getElementById("select").value)
{
case "1":
document.getElementById("change").innerHTML = "Option 1 has changed this DIV tag's content"
break;
case "2":
document.getElementById("change").innerHTML = "<font color='#ff0000'>Option 2 has changed this DIV tag's content</font>"
break;
case "3":
document.getElementById("change").innerHTML = "<font color='#0000ff'>Option 3 has changed this DIV tag's content"
break;
}
}
</script>
</head>
<body>
<select onchange="change()" id="select">
<option value="">Feel Free to choose</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<div id="change" style="display:inline;margin:10px;border:1px solid #999;">
Original Text
</div>
</body>
</html>
Bookmarks