입력 사용 요소가 사용자 입력을 받을 때 트리거할 이벤트 속성입니다. 다음 코드를 실행하여 oninput을 구현할 수 있습니다. 속성 -
예시
<!DOCTYPE html>
<html>
<body>
<p>Write your name below:</p>
<input type = "text" id = "myid" oninput="display()">
<p id="test"></p>
<script>
function display() {
var p = document.getElementById("myid").value;
document.getElementById("test").innerHTML = "Your answer is " + p;
}
</script>
</body>
</html>