You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.3 KiB
35 lines
1.3 KiB
1 month ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>简易计算器</title>
|
||
|
<link rel="stylesheet" href="styles.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="calculator">
|
||
|
<input type="text" id="display" disabled>
|
||
|
<div class="buttons">
|
||
|
<button onclick="appendNumber(7)">7</button>
|
||
|
<button onclick="appendNumber(8)">8</button>
|
||
|
<button onclick="appendNumber(9)">9</button>
|
||
|
<button onclick="chooseOperation('/')">/</button>
|
||
|
<button onclick="appendNumber(4)">4</button>
|
||
|
<button onclick="appendNumber(5)">5</button>
|
||
|
<button onclick="appendNumber(6)">6</button>
|
||
|
<button onclick="chooseOperation('*')">*</button>
|
||
|
<button onclick="appendNumber(1)">1</button>
|
||
|
<button onclick="appendNumber(2)">2</button>
|
||
|
<button onclick="appendNumber(3)">3</button>
|
||
|
<button onclick="chooseOperation('-')">-</button>
|
||
|
<button onclick="clearDisplay()">C</button>
|
||
|
<button onclick="appendNumber(0)">0</button>
|
||
|
<button onclick="appendDecimal('.')">.</button>
|
||
|
<button onclick="calculateResult('=')">=</button>
|
||
|
<button onclick="chooseOperation('+')">+</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
<script src="script.js"></script>
|
||
|
</body>
|
||
|
</html>
|