wgrk.net
当前位置:首页 >> js 选择年份 >>

js 选择年份

var curColor; var fontColor; function mouseover(obj) { curColor = obj.style.backgroundColor; fontColor = obj.style.color; obj.style.backgroundColor = "#CC0000"; obj.style.color = "White"; obj.style.cursor = 'pointer'; obj.styl...

window.onload = function() { var now = new Date(); var currentYear = now.getFullYear(); var currentMonth = now.getMonth() + 1; BindSelect(document.getElementById('year'), currentYear - 50, currentYear + 10, currentYear); BindS...

问题不详,请仔细描述你的提问 和你的目的。 var myDate = new Date();myDate.setFullYear(1992); // ************设置年份********/myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1970-????)myDate.getMon...

window.onload = function() { var sel = document.createElement('select'); var date = new Date(); for(var i=0;i

function validateYear(obj){ if(!/^\d{4}$/.test(obj.value)){ alert("请输入正确的年份"); return false; }return true; }

var date = new Date(); // new 一个Date对象var year = date.getFullYear(); // 年份var month = date.getMonth() + 1; // 月份(从0开始,所以应+1)for(var i = month; i > month - 6; i--) { $("" + year + "年" + i + "月" + "").appendTo(...

1、判断用户输入的是否有效日期 这个找一个日期校验函数即可 2、读取日期的年度,用函数getYear()或者getFullYear()

已测试成功 window.onload = function(){ getYear(); }; function getYear(){ function getEle(id){ return document.getElementById(id); } var inputPrev = getEle("prev"), inputNow = getEle("now"), inputNext = getEle("next"), d = new D...

var reg=/^(1949|19[5-9]\d|20\d{2}|2100)$/;

Jay 跨锐 onload = function () { var sel = document.getElementById ('sel'); for ( var i = 1970; i < 2015; i++) { var option = document.createElement ('option'); option.value = i; var txt = document.createTextNode (i); option.ap...

网站首页 | 网站地图
All rights reserved Powered by www.wgrk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com