getFullYear()
使用 getFullYear() 获取年份。
源代码:
[removed]
<!DOCTYPE html>
<html>
<body>
<p id=demo>Click the button to display the full year of todays date.</p>
<button onclick=myFunction()>Try it</button>
[removed]
function myFunction()
{
var d = new Date();
var x = document.getElementById(dem