- 测试代码
<body>
<input type="text" id="i1" />
<script>
const oI1 = document.querySelector('#i1')
oI1.addEventListener('keydown', function (e) {
console.log(e.key)
})
oI1.addEventListener('change', function () {
console.log('change')
})
</script>
</body>
标签:function,log,js,输入框,键会,change,addEventListener,oI1
From: https://www.cnblogs.com/isAyi/p/17713376.html