0
Why I can't set property onkeyup
input.onkeyup = function (){ } Why I can't setup property onkeyup....
2 ответов
+ 1
The object has to be selected.
For example with:
document.getElementById("objIdName").onkeyup = function ...
0
<body>
<form name="problem">
<input name="answer">
</form>
<script>
document.problem.answer.onkeyup = ()=>{
document.problem.answer.style.background="green";
}
</script>
</body>
Try this type a letter and see effect.