farve kode til textfelt(farve forsat)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
skift baggrundsfarve
</title>
<script type="text/javascript">
function setBgColor (id, color) {
if (document.layers)
document[id].bgColor = color == 'transparent' ? null : color;
else if (document.all)
document.all[id].style.backgroundColor = color;
else if (document.getElementById)
document.getElementById(id).style.backgroundColor = color;
}
</script>
</head>
<body>
<a href="java script: void 0"
onclick="setBgColor ('aCell', 'lime');
return false;">lime</a>
|
<a href="java script: void 0"
onclick="setBgColor ('aCell', 'c0c0c0');
return false;">hvid</a>
<br>
<p>
<a href="java script: void 0"
onclick="setBgColor ('bCell', 'lime');
return false;">lime</a>
|
<a href="java script: void 0"
onclick="setBgColor ('bCell', 'c0c0c0');
return false;">hvid</a>
<br>
</p>
<table border="0" cellspacing="1">
<tr>
<td id="aCell">
<td id="bCell">
<br>
</td>
</table>
<form method="POST" action="--WEBBOT-SELF--">
<p><input type="text" name="bCell" size="20"></p>
</form>
</body>
</html>
