When the following statement is called when the page has not been loaded, the "add" object cannot be obtained, and the prompt is empty or not an object
document.getElementById("add").onclick = function(){
alert("hello");
}
Objects that are available when used
window. onload = function(){
document.getElementById("add").onclick = function(){
alert("hello");
}
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn