我正在嘗試訪問 scalajs 中文本區域的值,如下所示:document.getElementById("editor").addEventListener("input", { (e: dom.Event) => console.log(e) console.log(document.getElementById("editor").getAttribute("value")) })但它總會回歸null。不知道為什么!我在普通的 JavaScript 中嘗試了同樣的事情,看起來效果很好!<script> document.getElementById("editor").addEventListener("input", function(){ console.log(document.getElementById("editor").value); });</script>我使用的是 scalajs 版本 1.3.1。任何幫助表示贊賞。TIA。
ScalaJS document.getElementById("editor")
臨摹微笑
2023-09-07 18:22:19