您的位置:首页 > Web前端 > JavaScript

JavaScript的对象举例

2016-03-02 16:20 513 查看
</pre><pre name="code" class="html"><!DOCTYPE html>
<html>
<body>

<p>点击按钮执行 displayDate() 函数.</p>

<button onclick="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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: