<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script type="text/javascript">
function click_action(){
alert('第一次');
var click_action2 = alertMsg("第二次了!");
document.getElementById("enjoy").onclick = click_action2 ;
}
function alertMsg(t) {
return function(){
alert(t);
}
}
</script>
</head>
<body>
<a id="enjoy" οnclick="click_action()" href="javascript:void(0);">点我</a>
</body>
</html>
两次不同的onclick事件
最新推荐文章于 2024-04-20 14:23:32 发布