<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<script src='cf.js' type='text/javascript'></script>
<h1>我的第一段 JavaScript</h1>
<p>
JavaScript 能够对事件作出反应。比如对按钮的点击:
</p>
<button type="button" οnclick="alert('Welcome!')">点击这里</button>
<button type="button" οnclick="mm()">点击这里</button>
<script>
//在这里编写嵌入html
function moveon() {
//通过弹出一个对话框来询问用户一个问题
var answer = confirm("准备好了吗?");
if(answer) window.location = "http:/taobao.com";
}
setTimeout(moveon,6000);
</script>
</body>
</html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<script src='cf.js' type='text/javascript'></script>
<h1>我的第一段 JavaScript</h1>
<p>
JavaScript 能够对事件作出反应。比如对按钮的点击:
</p>
<button type="button" οnclick="alert('Welcome!')">点击这里</button>
<button type="button" οnclick="mm()">点击这里</button>
<script>
//在这里编写嵌入html
function moveon() {
//通过弹出一个对话框来询问用户一个问题
var answer = confirm("准备好了吗?");
if(answer) window.location = "http:/taobao.com";
}
setTimeout(moveon,6000);
</script>
</body>
</html>