tryit_view.asp@filename=trydhtml_form_color

来自「W3Schools tutorial..web designing」· ASP@FILENAME=TRYDHTML_FORM_COLOR 代码 · 共 28 行

ASP@FILENAME=TRYDHTML_FORM_COLOR
28
字号
<html>
<head>
<script type="text/javascript">
function changeColor(color)
{
document.getElementById('x').style.background=color;
}
</script>
</head>

<body>

<p>This example demonstrates how to change the background color of an input field.</p>
<p>Mouse over the three colored table cells, and the input field will change background-color:</p>

<table width="100%"><tr>
<td bgcolor="red" onmouseover="changeColor('red')">&nbsp;</td>
<td bgcolor="blue" onmouseover="changeColor('blue')">&nbsp;</td>
<td bgcolor="green" onmouseover="changeColor('green')">&nbsp;</td>
</tr></table>

<form>
<input id="x" type="text" value="Mouse over the colors" size="20">
</form>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?