Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
niteshbca authored Apr 12, 2024
1 parent 89c6442 commit 548af1d
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Calculator</title>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Calculator</h1>
<br><br>
<div class="calculator">
<div class="display" id="display">0</div>
<button class="button" onclick="clearDisplay()">C</button>
<button class="button" onclick="appendToDisplay('7')">7</button>
<button class="button" onclick="appendToDisplay('8')">8</button>
<button class="button" onclick="appendToDisplay('9')">9</button>
<button class="button" onclick="appendToDisplay('+')">+</button>
<button class="button" onclick="appendToDisplay('4')">4</button>
<button class="button" onclick="appendToDisplay('5')">5</button>
<button class="button" onclick="appendToDisplay('6')">6</button>
<button class="button" onclick="appendToDisplay('-')">-</button>
<button class="button" onclick="appendToDisplay('1')">1</button>
<button class="button" onclick="appendToDisplay('2')">2</button>
<button class="button" onclick="appendToDisplay('3')">3</button>
<button class="button" onclick="appendToDisplay('*')">*</button>
<button class="button" onclick="appendToDisplay('0')">0</button>
<button class="button" onclick="calculateResult()">=</button>
<button class="button" onclick="appendToDisplay('/')">/</button>
</div>
<div class="calculator">
<input type="text" id="display" readonly>
<br>
<input type="button" value="7" onclick="addToDisplay('7')">
<input type="button" value="8" onclick="addToDisplay('8')">
<input type="button" value="9" onclick="addToDisplay('9')">
<input type="button" value="/" onclick="addToDisplay('/')">
<br>
<input type="button" value="4" onclick="addToDisplay('4')">
<input type="button" value="5" onclick="addToDisplay('5')">
<input type="button" value="6" onclick="addToDisplay('6')">
<input type="button" value="*" onclick="addToDisplay('*')">
<br>
<input type="button" value="1" onclick="addToDisplay('1')">
<input type="button" value="2" onclick="addToDisplay('2')">
<input type="button" value="3" onclick="addToDisplay('3')">
<input type="button" value="-" onclick="addToDisplay('-')">
<br>
<input type="button" value="." onclick="addToDisplay('.')">
<input type="button" value="0" onclick="addToDisplay('0')">
<input type="button" value="=" onclick="calculate()">
<input type="button" value="+" onclick="addToDisplay('+')">
<br>
<input type="button" value="C" onclick="clearDisplay()">
</div>

<script src="javascript.js">

</script>
<script src="javascript.js"></script>
</body>
</html>

0 comments on commit 548af1d

Please sign in to comment.