<!doctype?html>
<html>
<head>
????<meta?charset="UTF-8">
<title>Document</title>
<script>
??????window.onload=function(){
???????var?login_btn=document.getElementById('login');
login_btn.onclick=showMes;
function?showMes(e){
alert(e.type);
}
?}?????
</script>
</head>
<body>
<div><input?type="button"?value="登?錄"?id="login"></div>
</body>
</html>就上面的代碼中封裝showMes函數(shù)的時候有參數(shù)e,為什么調用的時候不用輸入?yún)?shù)。是這種設置事件的時候不傳入?yún)?shù)就是event的意思嗎?
為什么設置事件的時候不傳入?yún)?shù)代表event?
Whitney_Wang
2016-10-22 20:14:24
