JavaScriptのまったくの初心者で、基礎的な質問につき恐縮です。
計算!!のボタンを押しても、計算結果が表示されません。
クリアは反応するのですが、どうしたらいいのか。
ご教授お願い致します。
html
1<html> 2<head> 3<meta http-equiv="Content-script-Type" content="text/javascript"> 4<meta http-equiv="Content-Style-Type" content="text/css"> 5<script type="text/javascript"> 6function calc(cl){cl.z.valu = eval(cl.x.value)+eval(cl.y.value)} 7</script> 8</head> 9<body> 10*フォームに入力された文字列を計算できるようにする 11 <form name = 'calc'> 12 <input type = "text" name="x" value="0" size="10"> 13 + 14 <input type = "text" name="x" value="0" size="10"> 15 = 16 <input type = "text" name="z" value="0" size="10"> 17 <input type="button" value="計算!!" onclick = "calc(this.form)"> 18 <input type="reset" value="clear"> 19 </form> 20 21 22</body> 23</html>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。