var now = new Date(); function setDate(type, id, from, to) { var str = ""; for (var i = from; i < to + 1; i++) { if ((type == "y" && i == now.getFullYear()) || (type == "m" && i == now.getMonth() + 1) || (t
HTML标签 select 里 动态添加option: ☆ var today = new Date(); var yearNow = today.getFullYear(); var optiongYears_className = [yearNow, yearNow+1]; var $selyear = $("select#classNameYear_add"); $.each(optiongYears_className, function (i, val) { if(i==0)
1.动态创建select function createSelect(){ var mySelect = document.createElement("select"); mySelect.id = "mySelect"; document.body.appendChild(mySelect); } 2.添加选项option function addOption(){ //根据id查找对象, var