📌  相关文章
📜  未捕获的 ReferenceError:函数未在 HTMLUnknownElement.onclick 中定义 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:12.748000             🧑  作者: Mango

代码示例1
//Your program can't find the function so do this.

//You can assign the button onclick as an id.
//then attach an eventListener on run time like this:



var btn = document.getElementById("btn");
btn.addEventListener("click", function() {
    //Do something here
}, false);