</pre><pre name="code" class="html"><!DOCTYPE html>
<html>
<body>
<p>点击按钮执行 displayDate() 函数.</p>
<button οnclick="displayDate()">点这里</button>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
<p id="demo"></p>
</body>
</html>
</pre><pre name="code" class="html">从菜鸟教程里面摘抄:<a target=_blank href="http://www.runoob.com/js/js-tutorial.html">http://www.runoob.com/js/js-tutorial.html</a>