与其放在电脑里占内存,还不如拿出来帮助一群小白白之html篇之十一

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js</title>
<style>
input{
margin: 10px;
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>

何以飘零去,何以少团栾,何以离别久,何以不得安。
原文地址:https://www.cnblogs.com/mikou2017/p/6884529.html