时间:2024-10-30 20:17:31
1、新建一个html文件,命名为test.html,用于讲解js如何将当前时间的年份显示出来。
3、在js标签内,使用new Date()获得当前时间。
5、在js标签内,使用alert方法输出年份。