该计算器功能: 1.校验:小数点,重复计算,以及大量更符合用户体验的操作。 2.能够从键盘输入。
效果图:
HTML代码:
<Meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Insert title here
<input type="button" class="button" name="deleteAll" value="C" onclick="clearAllText()" />
<input type="button" class="button" name="opposite" value="+/-" onclick="oppositeOp()" />
<input type="button" class="button" name="delOne" value="←" onclick="deleteOneDigit()" />
<input type="button" class="button" name="Add" value="+" onclick="clickOperation('+')" />
<input type="button" class="button" name="seven" value="7" onclick="clickNum(7)" />
<input type="button" class="button" name="eight" value="8" onclick="clickNum(8)" />
<input type="button" class="button" name="nine" value="9" onclick="clickNum(9)" />
<input type="button" class="button" name="Reduce" value="-" onclick="clickOperation('-')" />
<input type="button" class="button" name="Four" value="4" onclick="clickNum(4)" />
<input type="button" class="button" name="Five" value="5" onclick="clickNum(5)" />
<input type="button" class="button" name="Sex" value="6" onclick="clickNum(6)" />
<input type="button" class="button" name="Multip" value="x" onclick="clickOperation('x')" />
<input type="button" class="button" name="One" value="1" onclick="clickNum(1)" />
<input type="button" class="button" name="Two" value="2" onclick="clickNum(2)" />
<input type="button" class="button" name="Three" value="3" onclick="clickNum(3)" />
<input type="button" class="button" name="Division" value="÷" onclick="clickOperation('/')" />
<input type="button" class="button" name="opposite" value="√" onclick="more()" />
<input type="button" class="button" name="Zero" value="0" onclick="clickNum(0)" />
<input type="button" class="button" name="Point" value="." onclick="clickNum('.')" />
<input type="button" class="button" name="Equal" value="=" onclick="calcu()" />
</div>
</form>