このコードは Chrome では機能しますが、IE では機能しません。どうして??とても簡単ですが、間違いがわかりません。
<script>
function calc() {
var summ = (parseFloat(q2.value) + parseFloat(q3.value) + parseFloat(q4.value)+ ( parseFloat(qn2.value) + parseFloat(qn3.value) + parseFloat(qn4.value) ) * 6 ) * 1.13;
summ = parseFloat(summ).toFixed(2);
document.getElementById('sum2').innerHTML = summ;
alert(summ);
}
</ script>
と html (すべてのテキストを削除し、入力のみ)
<form method="" action="">
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q2"/>
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q3"/>
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '00.00';}" value="00.00" maxlength="14" size="4" id="q4"/>
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn2"/>
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn3"/>
<input type="number" onClick="calc();" onChange="calc();" onblur="if (this.value == '') {this.value = '0';}" value="0" maxlength="14" size="4" id="qn4"/>
<p><span id="sum2" style="color: red; font-weight: bold;">00.00</span> the result</p>
<center><input type='button' onclick='calc()' value='Обновить'/></center>
</ html>
私は何を間違っていますか?私はすでに、IE が気に入らずname="..." tag
、コードからそれらすべてを削除していることに気付きました。