function res(){var di = document.getElementById("xvalue")vaule;var zhi = document.getElementById("yvalue")value;var jieguo = Math.pow(di,zhi);document.getElementById("result").value = jieguo;}</script><form action="" id="mijs">請輸入底數(shù)<br /><input type="txt" name="xvalue" id="x" / ><br />請輸入指數(shù)<br /><input type="txt" name="yvalue" id="y" /><br /><input type = "button" value ="開始計算" id="cal" onclick="res()"><br />結果<br /><input type="txt" id="result" />在結果框中沒有出現(xiàn)計算結果,將計算結果框賦值的那里錯了嗎?
用JS寫一個指數(shù)計算器,請教哪里錯了?
手掌心
2018-08-11 10:09:31