<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
</head>
<body>
<input type="button" id="but1" value="按钮">
<script type="text/JavaScript">
function showtt(){
alert("你应该知道些知识");
}
var event={
add:function(a,b,c){
if(a.addEventListener)
{a.addEventListener(b, c, false);}
else if(a.attachEvent)
{a.attachEvent('on'+b,c);}
else
{a['on'+b]=c;}
}
}
rem:function(a,b,c){
if(a.removeEventListener)
{a.removeEventListener(b, c, false);}
else if(a.detachEvent)
{a.detachEvent('on'+b,c);}
else
{a['on'+b]=null;}
}
}
event.add(btn1,'click',showtt);
</script>
</body>
</html>
_bug终结者_
程序猿天璇
相关分类