Home  >  Article  >  Web Front-end  >  Example of moving a drop-down list select from the left border to the right_javascript skills

Example of moving a drop-down list select from the left border to the right_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:10:461282browse

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

Copy code The code is as follows:

document.getElementById("add").onclick = function(){
alert("hello");
}

Objects that are available when used
Copy code The code is as follows:

window. onload = function(){
document.getElementById("add").onclick = function(){
alert("hello");
}
}

Copy code The code is as follows:





















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