最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

請教關(guān)于日期函數(shù)的問題

function window_onload()
{
?? ?var myForm = document.form1;
?? ?var nowDate = new Date();
?? ?myForm.firstDay.options[nowDate.getDate()-1].selected = true;
?? ?myForm.secondDay.options[nowDate.getDate()-1].selected =true;
??? myForm.secondMonth.options[nowDate.getMonth()].selected =true;
?? ?myForm.firstMonth.options[nowDate.getMonth()].selected = true;
?? ?myForm.firstYear.options[nowDate.getFullYear()-1970].selected =true;
?? ?myForm.secondYear.options[nowDate.getFullYear()-1970].selected =true;
}
//可以執(zhí)行,返回firstDay,secondDay.options【】對象的值為當(dāng)前時(shí)間,,
function window_onload()
{
?? ?var myForm = document.form1;
?? ?var nowDate = new Date();
?? ?myForm.firstDay.options[nowDate.getDate()-1].selected = true;
?? ?myForm.firstMonth.options[nowDate.getMonth()].selected = true;
?? ?myForm.firstYear.options[nowDate.getFullYear()-1970].selected =true;
?? ?myForm.secondDay.options[nowDate.getDate()-1].selected =true;
?? ?myForm.secondMonth.options[nowDate.getMonth()].selected =true;?? ?
?? ?myForm.secondYear.options[nowDate.getFullYear()-1970].selected =true;
}

順序更改后,firstDay 正常返回當(dāng)前日期,secondDay則無法返回當(dāng)前日期,為什么???

正在回答

1 回答

給一下你的完整代碼看一下,包括html結(jié)構(gòu)

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

qq_無心_12 提問者

非常感謝!
2015-12-28 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JavaScript進(jìn)階篇
  • 參與學(xué)習(xí)       469026    人
  • 解答問題       22582    個(gè)

本課程從如何插入JS代碼開始,帶您進(jìn)入網(wǎng)頁動態(tài)交互世界

進(jìn)入課程

請教關(guān)于日期函數(shù)的問題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號