我正在尝试使文本字段更改其颜色,但它似乎不起作用这是代码:
<html>
<head>
<title>
This is a title
</title>
<script type="text/javascript">
function changeColor()
{
alert("bla")
document.getElemenyById("text1").style.background-color:red;
}
</script>
</head>
<body>
<form>
<input id="text1" type="text" onkeypress="changeColor()">
</form>
</body>
</html>
- 谢谢你