html
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
<!-- Created by TR CodeWorld [AYUSH.ks]-->
<!-- A web code for a normal calculator with all the functions
Author = Ayush
Created on = 4th march 2020
Subject = Calculator
Special thanks to AJ #level 20End game and
RK 8 for their help.
-->
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<center>
<div class="calc">
<p id="all"></p>
<br><br>
<button onclick="ak()" style="background-color:red;">INFO</button>
<button onclick="aper()" id="del">%</button>
<button onclick="del()" id="del">Del</button>
<button onclick="ac()" id="del">Clear</button>
<br>
<button onclick="a7()" id="num">7</button>
<button onclick="a8()" id="num">8</button>
<button onclick="a9()" id="num">9</button>
<button onclick="add()" id="sy">+</button>
Enter to Rename, Shift+Enter to Preview
css
css
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
/* Created by TR CodeWorld [AYUSH.ks] */
body {
background-color: white;
}
.calc{
border:1px solid #f9f9f9;
height:520px;
position: absolute ;
top: 0;
left: 0;
width:100%;
border-radius:10px;
background-color: #f0f0f0;
}
#del{
background-color: orange;
}
p{
height:40px;
width:90%;
background-color: white;
border: 2px solid #f9f9f9;
box-shadow: 2px 2px 1px rgba(0,0,0,0.1);
overflow-x:scroll;
font-size: 20px;
Enter to Rename, Shift+Enter to Preview
js
js
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
// Created by TR CodeWorld [AYUSH.ks]
/* Javascript code goes here */
var arr = [];
function del(){
arr.splice(-1,1);//cut last digit
total();//sends the value to p after cutting last degit
}
function ac(){
document.getElementById("all").innerHTML="";
arr = new Array ;//clear Array along with p
}
function aper(){
var b1 = "%";
arr.push(b1);
total();
}
function ak() {
var info = document.getElementById("all");
info.innerHTML="Hi guys this is my new web project . which is a simple calculator. I hope that you may all love it.Co-styled by @Ndefru Brayan Aya";
}
function a1(){
var b1 = "1";
arr.push(b1);
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run