<html>
<head>
<meta charset="UTF-8">
<title>学习JavaScript的第一天
</title>
</head>
<script src="./js/index.js" charset="UTF-8"></script>
<body>
<button onclick="myclick()">点击我
</button>
<button onclick="myWrite()">点击我
</button>
<button onclick="myConsole()">点击我
</button>
<button onclick="myLabel()">点击我
</button>
<div id="mydiv"></div>
</body>
</html>
function myclick() {
window
.alert("现在是北京时间18点整");
}
function myWrite() {
document
.write(Date());
}
function myConsole() {
console
.log(Date())
}
function myLabel() {
document
.getElementById("mydiv").innerHTML
= "<font color='red'>"+Date()+"</font>";
}
节约时间,看看演示:
转载请注明原文地址:https://ipadbbs.8miu.com/read-895.html