與其放在電腦裏占內存,還不如拿出來幫助一群小白白之html篇之十一
阿新 • • 發佈:2017-05-21
dcl body window let ctype urn doctype 繼續 document
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js</title>
<style>
input{
margin: 10px;
width: 100px;
height: 30px;
}
</style>
</head>
<body>
<input id="button1" type="button" value="button1">
<input id="button2" type="button" value="動態添加事件" onclick="addClick(button1)">
<input type="button" value="提交" onclick="check()">
<script>
function addClick(obj){
obj.onclick=function(){
alert(‘動態添加事件成功‘);
}
}
</script>
<script>
function check(){
if(window.document.readyState==‘complete‘){
alert("加載完畢,可以繼續");
return true;
}else{
alert("正在處理,請等待!");
return false;
}
}
</script>
</body>
</html>
與其放在電腦裏占內存,還不如拿出來幫助一群小白白之html篇之十一