javascript显示日期

<!DOCTYPE html>
<html>
<script type="text/javascript"> 
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
<body>
<button type="button" onclick="displayDate()">显示日期</button>
<p id="demo"><p>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/wyhwlls/article/details/84143837