| 
9 | 9 | <body>  | 
10 | 10 |   <div id="main">  | 
11 | 11 |     <div id="calculator">  | 
12 |  | -      <input type="text" name="" id="input-box">  | 
 | 12 | +      <input type="text" id='input-box' readonly>  | 
13 | 13 |       <div id="btn-container">  | 
14 |  | -        <button class="extra-btn1">C</button>  | 
15 |  | -        <button class="extra-btn1">/</button>  | 
16 |  | -        <button class="extra-btn1">*</button>  | 
17 |  | -        <button class="extra-btn1">-</button>  | 
18 |  | -        <button>7</button>  | 
19 |  | -        <button>8</button>  | 
20 |  | -        <button>9</button>  | 
21 |  | -        <button class="extra-btn1">+</button>  | 
22 |  | -        <button>4</button>  | 
23 |  | -        <button>5</button>  | 
24 |  | -        <button>6</button>  | 
25 |  | -        <button class="extra-btn1">%</button>  | 
26 |  | -        <button>1</button>  | 
27 |  | -        <button>2</button>  | 
28 |  | -        <button>3</button>  | 
29 |  | -        <button class="extra-btn1">.</button>  | 
30 |  | -        <button>0</button>  | 
31 |  | -        <button class="extra-btn">=</button>  | 
 | 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>  | 
32 | 86 |       </div>  | 
33 | 87 |     </div>  | 
34 | 88 |   </div>  | 
 | 
0 commit comments