repl.it
HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • script.js
  • style.css
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="script.js"></script>
  </head>
  <body>
    <p>This is a simple calculator.</p>
    <div>
      
    <form name="calc">
      <input type="text" name="ans" id="ans" disabled>
      <br>
      <button type="button" onclick="myFunction(7)">7</button>
      <button type="button" onclick="myFunction(8)">8</button>
      <button type="button" onclick="myFunction(9)">9</button>
      <button type="button" onclick="addmoTo(); reset();">+</button>
      <br>
      <button type="button" onclick="myFunction(4)">4</button>
      <button type="button" onclick="myFunction(5)">5</button>
      <button type="button" onclick="myFunction(6)">6</button>
      <button type="button" onclick="submoTo()">-</button>
      <br>
      <button type="button" onclick="myFunction(1)">1</button>
      <button type="button" onclick="myFunction(2)">2</button>
      <button type="button" onclick="myFunction(3)">3</button>
      <button type="button" onclick="mulmoTo()">x</button>
      <br>
      <button type="button" onclick="myFunction(0);">0</button>
      <button type="button" onclick="lagayDot()">. </button>
      <button type="button" onclick="expmoTo()">^</button>
      
      <button type="button" onclick="divmoTo()">÷</button>
      <br>
      <button type="button" onclick="piMoto()">π</button>
      <button type="button" onclick="sqrtmoTo()"></button>
      <button type="button" onclick="clearAll();reset();">C</button>
      <button type="button" onclick="equalmoTo()">=</button>

    </form>
    </div>
  </body>
</html>
result
console