js如何获取input中target下的value字符串?-灵析社区

Ufoooo4U

直接通过 `event.target.value` 就可以获取到了哇。 const myInput = document.querySelector("input"); myInput.addEventListener("input", (event) => { document.querySelector("#inputContent").innerText = event.target.value });

阅读量:1

点赞量:0

问AI