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

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

這行代碼哪里有錯(cuò)啊,無論怎么點(diǎn)”=“都沒用 ,求大神解答!

這行代碼哪里有錯(cuò)啊,無論怎么點(diǎn)”=“都沒用 ,求大神解答!

_linux_program 2016-01-04 18:20:01
<!DOCTYPE html><html>?<head>? <title> 事件</title> ?? <script type="text/javascript">? ?function count()? ?{? ? ? ?var x,y,bb;? ? ? ?x=document.getElementById(txt1).value;? ? ? ?y=document.getElementById(txt2).value;? ? ? ?bb=document.getElementById(select).value;? ? ? ?var result="";? ? ? ?switch(bb)? ? ? ? ? ?{? ? ? ? ? ? ? ?case "+":? ? ? ? ? ? ? ? ? ?result=parseInt(x)+parseInt(y);? ? ? ? ? ? ? ? ? ?break;? ? ? ? ? ? ? ?case "-":? ? ? ? ? ? ? ? ? ?result=parseInt(x)-parseInt(y);? ? ? ? ? ? ? ? ? ?break;? ? ? ? ? ? ? ? case "*":? ? ? ? ? ? ? ? ? ? result=parseInt(x)*parseInt(y);? ? ? ? ? ? ? ? ? ? break;? ? ? ? ? ? ? ? default :? ? ? ? ? ? ? ? ? ? result=parseInt(x)/parseInt(y);? ? ? ? ? ?}? ? document.getElementById("fruit").value=result;? ?}? </script>??</head>??<body>? ?<input type='text' id='txt1' />?? ?<select id='select'> <option value='+'>+</option> <option value="-">-</option> <option value="*">*</option> <option value="/">/</option>? ?</select>? ?<input type='text' id='txt2' />?? ?<input type='button' value=' = ' onclick="count()"/> <!--通過 = 按鈕來調(diào)用創(chuàng)建的函數(shù),得到結(jié)果-->?? ?<input type='text' id='fruit' /> ???</body></html>
查看完整描述

1 回答

已采納
?
ppo_YXWU

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

? ? ? ?x=document.getElementById(txt1).value;

? ? ? ?y=document.getElementById(txt2).value;

? ? ? ?bb=document.getElementById(select).value;

這里出錯(cuò)了,括號里面要加引號,這些問題你用控制臺很簡單可以找出的。

查看完整回答
反對 回復(fù) 2016-01-04
  • _linux_program
    _linux_program
    謝謝!輸快了忘了 控制臺是什么?IDE?
  • ppo_YXWU
    ppo_YXWU
    瀏覽器基本都有開發(fā)者工具的,通常是按F12,開發(fā)者工具有很多功能,可以在瀏覽器上調(diào)試你的頁面,有錯(cuò)誤的時(shí)候會在控制臺顯示出來。
  • _linux_program
    _linux_program
    哦哦 firebug 嘗試中 謝謝了
  • 1 回答
  • 0 關(guān)注
  • 1328 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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