最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

根據(jù)出生日期自動取得星座的js代碼

 更新時間:2010年07月20日 00:55:48   作者:  
最近這個項目需要注冊時用戶填寫出生日期,然后自動取得星座,想想好像用后臺代碼太麻煩只好轉(zhuǎn)而使用JavaScript。
無奈啊~只怪讀書時沒有好好用功~看著JavaScript,一個頭頓時變成兩個。。。。。。。。
還好網(wǎng)絡提供了很好的資料庫~看了下,然后自己改了下,基本算能完成任務吧~寫下一份存檔,留待日后
復制代碼 代碼如下:

function xingzuo() {
var start = 1901, date=document.getElementById("txtDay").value, month=document.getElementById("txtMonth").value;;
with (document.getElementById("txtXZ")){
if (month == 1 && date >=20 || month == 2 && date <=18) {value = "水瓶座";}
if (month == 1 && date > 31) {value = "Huh?";}
if (month == 2 && date >=19 || month == 3 && date <=20) {value = "雙魚座";}
if (month == 2 && date > 29) {value = "Say what?";}
if (month == 3 && date >=21 || month == 4 && date <=19) {value = "白羊座";}
if (month == 3 && date > 31) {value = "OK. Whatever.";}
if (month == 4 && date >=20 || month == 5 && date <=20) {value = "金牛座";}
if (month == 4 && date > 30) {value = "I'm soooo sorry!";}
if (month == 5 && date >=21 || month == 6 && date <=21) {value = "雙子座";}
if (month == 5 && date > 31) {value = "Umm ... no.";}
if (month == 6 && date >=22 || month == 7 && date <=22) {value = "巨蟹座";}
if (month == 6 && date > 30) {value = "Sorry.";}
if (month == 7 && date >=23 || month == 8 && date <=22) {value = "獅子座";}
if (month == 7 && date > 31) {value = "Excuse me?";}
if (month == 8 && date >=23 || month == 9 && date <=22) {value = "室女座";}
if (month == 8 && date > 31) {value = "Yeah. Right.";}
if (month == 9 && date >=23 || month == 10 && date <=22) {value = "天秤座";}
if (month == 9 && date > 30) {value = "Try Again.";}
if (month == 10 && date >=23 || month == 11 && date <=21) {value = "天蝎座";}
if (month == 10 && date > 31) {value = "Forget it!";}
if (month == 11 && date >=22 || month == 12 && date <=21) {value = "人馬座";}
if (month == 11 && date > 30) {value = "Invalid Date";}
if (month == 12 && date >=22 || month == 1 && date <=19) {value = "摩羯座";}
if (month == 12 && date > 31) {value = "No way!";}
}
}

相關(guān)文章

最新評論

乌海市| 黑水县| 仁化县| 黎平县| 湖南省| 鄯善县| 长白| 邓州市| 邮箱| 达尔| 垫江县| 开封县| 安达市| 青岛市| 建始县| 东阳市| 郧西县| 论坛| 永昌县| 砚山县| 新竹县| 邯郸县| 四川省| 迭部县| 获嘉县| 辛集市| 青浦区| 都匀市| 富裕县| 永康市| 隆昌县| 朝阳县| 隆回县| 雅安市| 涿州市| 商洛市| 花莲县| 铜鼓县| 昭觉县| 镇赉县| 垣曲县|