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

來源:互聯網
上載者:User
關鍵字 網頁製作 Ajax JavaScript

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!";}


}


}

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.