| 
11 | 11 |     <div id="calculator">  | 
12 | 12 |       <input type="text" id='input-box' readonly>  | 
13 | 13 |       <div id="btn-container">  | 
14 |  | -        <button class="extra-btn1" onclick="  | 
15 |  | -        currentDisplay ='';  | 
16 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
17 |  | -        ">C</button>  | 
18 |  | -        <button class="extra-btn1" onclick="  | 
19 |  | -        currentDisplay =currentDisplay+'/';  | 
20 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
21 |  | -        ">/</button>  | 
22 |  | -        <button class="extra-btn1" onclick="  | 
23 |  | -        currentDisplay =currentDisplay+'*';  | 
24 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
25 |  | -        ">*</button>  | 
26 |  | -        <button class="extra-btn1" onclick="  | 
27 |  | -        currentDisplay =currentDisplay+'-';  | 
28 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
29 |  | -        ">-</button>  | 
30 |  | -        <button onclick="  | 
31 |  | -        currentDisplay =currentDisplay+'7';  | 
32 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
33 |  | -        ">7</button>  | 
34 |  | -        <button onclick="  | 
35 |  | -        currentDisplay =currentDisplay+'8';  | 
36 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
37 |  | -        ">8</button>  | 
38 |  | -        <button onclick="  | 
39 |  | -        currentDisplay =currentDisplay+'9';  | 
40 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
41 |  | -        ">9</button>  | 
42 |  | -        <button class="extra-btn1" onclick="  | 
43 |  | -        currentDisplay =currentDisplay+'+';  | 
44 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
45 |  | -        ">+</button>  | 
46 |  | -        <button onclick="  | 
47 |  | -        currentDisplay =currentDisplay+'4';  | 
48 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
49 |  | -        ">4</button>  | 
50 |  | -        <button onclick="  | 
51 |  | -        currentDisplay =currentDisplay+'5';  | 
52 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
53 |  | -        ">5</button>  | 
54 |  | -        <button onclick="  | 
55 |  | -        currentDisplay =currentDisplay+'6';  | 
56 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
57 |  | -        ">6</button>  | 
58 |  | -        <button class="extra-btn1" onclick="  | 
59 |  | -        currentDisplay =currentDisplay+'%';  | 
60 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
61 |  | -        ">%</button>  | 
62 |  | -        <button onclick="  | 
63 |  | -        currentDisplay =currentDisplay+'1';  | 
64 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
65 |  | -        ">1</button>  | 
66 |  | -        <button onclick="  | 
67 |  | -        currentDisplay =currentDisplay+'2';  | 
68 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
69 |  | -        ">2</button>  | 
70 |  | -        <button onclick="  | 
71 |  | -        currentDisplay =currentDisplay+'3';  | 
72 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
73 |  | -        ">3</button>  | 
74 |  | -        <button class="extra-btn1" onclick="  | 
75 |  | -        currentDisplay =currentDisplay+'.';  | 
76 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
77 |  | -        ">.</button>  | 
78 |  | -        <button onclick="  | 
79 |  | -        currentDisplay =currentDisplay+'0';  | 
80 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
81 |  | -        ">0</button>  | 
82 |  | -        <button class="extra-btn" onclick="  | 
83 |  | -        currentDisplay =eval(currentDisplay);  | 
84 |  | -        document.querySelector('#input-box').value = currentDisplay;  | 
85 |  | -        ">=</button>  | 
 | 14 | +        <button class="extra-btn1" onclick="clearDisplay()">C</button>  | 
 | 15 | +        <button class="extra-btn1" onclick="appendToDisplay('/')">/</button>  | 
 | 16 | +        <button class="extra-btn1" onclick="appendToDisplay('*')">*</button>  | 
 | 17 | +        <button class="extra-btn1" onclick="appendToDisplay('-')">-</button>  | 
 | 18 | +        <button onclick="appendToDisplay('7')">7</button>  | 
 | 19 | +        <button onclick="appendToDisplay('8')">8</button>  | 
 | 20 | +        <button onclick="appendToDisplay('9')">9</button>  | 
 | 21 | +        <button class="extra-btn1" onclick="appendToDisplay('+')">+</button>  | 
 | 22 | +        <button onclick="appendToDisplay('4')">4</button>  | 
 | 23 | +        <button onclick="appendToDisplay('5')">5</button>  | 
 | 24 | +        <button onclick="appendToDisplay('6')">6</button>  | 
 | 25 | +        <button class="extra-btn1" onclick="appendToDisplay('%')">%</button>  | 
 | 26 | +        <button onclick="appendToDisplay('1')">1</button>  | 
 | 27 | +        <button onclick="appendToDisplay('2')">2</button>  | 
 | 28 | +        <button onclick="appendToDisplay('3')">3</button>  | 
 | 29 | +        <button class="extra-btn1" onclick="appendToDisplay('.')">.</button>  | 
 | 30 | +        <button onclick="appendToDisplay('0')">0</button>  | 
 | 31 | +        <button class="extra-btn" onclick="calculateResult()">=</button>  | 
86 | 32 |       </div>  | 
87 | 33 |     </div>  | 
88 | 34 |   </div>  | 
 | 
0 commit comments