1.获取服务器时间: var now = new Date($.ajax({async: false}).getResponseHeader("Date")); 2.new Date()用法(获取客户端时间): 获取年: var currentYear = now.getFullYear(); 获取月: var currentMonth = now.getMonth(); 获取日: var currentDay = now.getDate(); 获取小时: var currentHou…
<select id="year" style="width: 100px;"></select> <select id="month" style="width: 100px;"></select> //初始化年 var now = new Date(); var nowYear = now.getFullYear(); …
先来看一个例子: 不获取 id 也可以使用 id 元素. <!-- Author: XiaoWen Create a file: 2017-01-11 13:58:01 Last modified: 2017-01-11 14:00:28 Start to work: Finish the work: Other information: --> <!DOCTYPE html> <html lang="en"> <head> <me…