input变化事件-JS改变input的value值触发事件
<!DOCTYPE html> <html> <body> <p>在文本框中尝试输入触发函数。</p> <input type="text" id="myInputyt" oninput="myFunction()"> <p id="yt575271"></p> <script> function myFunction() { var x = document.getElementById("myInputyt").value; document.getElementById("yt575271").innerHTML = "您写入值是: " + x; } </script> </body> </html>