htmlshijian.html文件
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Html welcome you</title>
<script type="text/javascript">
function a() {
alert('Html welcome you');
}
</script>
</head>
<body>
<h1>Html welcome you</h1>
<form action=""><input id="btnAlert" type="button" onclick="a();"
value="alert" /></form>
</body>
</html>
htmlshijian.html文件
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Html welcome you</title>
<script>
function a(){
alert('some thing');
}
window.onload=function(){
document.getElementById("btn").onclick=a;
}
</script>
</head>
<body>
<h1>Html welcome you</h1>
<form action=""><input id="btn" type="button" value="shijian" /></form>
</body>
</html>
柳德才
13691193654
18942949207
QQ:422157370
liudecai_zan@126.com湖北-武汉-江夏-庙山