第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我如何使這段代碼給出預(yù)期的結(jié)果

我如何使這段代碼給出預(yù)期的結(jié)果

HUWWW 2023-02-24 15:37:42
function myfun(){   //var yofad = document.getElementById('age').value;   var yoad;   var year = 2014 ;     if( year >= 2014){        yoad = "Your certicate is ready go to school portal";      } else if (year == 2019){        yoad = "Your certificate is in progress";      } else {        yoad = "cert not found";      }document.getElementById('cc').innerHTML=yoad}<h6>Enter your year of admission to know if your certificate is ready</h6><input id="age"><button onclick="myfun()">enter</button><p id="xc"></p><p id="cc"></p>當(dāng)輸入介于 2014 和 2019 之間時(shí),我希望輸出為“您的證書(shū)已準(zhǔn)備好去學(xué)校門(mén)戶(hù)網(wǎng)站”,當(dāng)輸入高于 2019 時(shí),輸出應(yīng)為 cert is not read
查看完整描述

3 回答

?
江戶(hù)川亂折騰

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超5個(gè)贊

只需使用并操作它會(huì)幫助您檢查 2 個(gè)條件


function myfun(){

   //var yofad = document.getElementById('age').value;

   var yoad;

   var year = 2014 ;

     if( year >= 2014 && year <2019){

        yoad = "Your certicate is ready go to school portal";

      }else if (year == 2019){

       yoad = "Your certificate is in progress";

      } else {

        yoad = "cert not found";

      }

document.getElementById('cc').innerHTML=yoad

}


查看完整回答
反對(duì) 回復(fù) 2023-02-24
?
慕絲7291255

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊

將您的第一個(gè)條件限制為小于 2019,否則對(duì)于 2019、2020 和其他更大的值也將成立。改為if(year >= 14)_if(year >= 14 && year <2019)


function myfun(){

   var year = document.getElementById('age').value;

   var yoad;

     if( year >= 2014 && year < 2019){

        yoad = "Your certicate is ready go to school portal";

      } else if (year == 2019){

        yoad = "Your certificate is in progress";

      } else {

        yoad = "cert not found";

      }

document.getElementById('cc').innerHTML=yoad

}

<h6>Enter your year of admission to know if your certificate is ready</h6>

<input id="age">

<button onclick="myfun()">enter</button>

<p id="xc"></p>

<p id="cc"></p>


查看完整回答
反對(duì) 回復(fù) 2023-02-24
?
桃花長(zhǎng)相依

TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超8個(gè)贊

function myfun(){

  document.getElementById('cc').innerHTML = "";

  const value = document.getElementById('age').value;

  if (!value) return;

  

  const year = parseInt(value);

  let yoad;

  

  if (year > 2019) {

    yoad = "certicate not read";

  } else if (year >= 2014 && year <= 2019) {

    yoad = "Your certicate is ready go to school portal";

  } else {

    yoad = "cert not found";

  }

  

  document.getElementById('cc').innerHTML = yoad

}

<h6>Enter your year of admission to know if your certificate is ready</h6>

<input id="age">

<button onclick="myfun()">enter</button>

<p id="xc"></p>

<p id="cc"></p>

也許你需要這樣的東西!



查看完整回答
反對(duì) 回復(fù) 2023-02-24
  • 3 回答
  • 0 關(guān)注
  • 169 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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