ক্যালকুলেটর বানাইতাসি
*{
margin:0;
padding:0;
}
body{
background:pink;
}
.calculator{
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
button{
height:60px;
width:60px;
margin:0px;
border:none;
border-radius:50px;
background: #111111;
color:#fff;
font-size:25px;8
cursor:none;
}
button:hover{
background:#000;
}
.textview{
width:230px;
height:80px;
margin:5px;
padding:8px;
font-size:30px;
border:none;
border-radius:5px;
}
div{
border-width: 10px;
border-style: solid;
width: 255px;
height: 425px;
border-color: #777777;
}
| AC | Del | ÷ | × |
| 7 | 8 | 9 | – |
| 4 | 5 | 6 | + |
| 1 | 2 | 3 | |
| 0 | . | = | |
function insert(num){
document.form.textview.value = document.form.textview.value+num;
}
function equal(){
var exp = document.form.textview.value;
document.form.textview.value = eval(exp);
}
function clean(){
document.form.textview.value = “”;
}
function back(){
var exp = document.form.textview.value;
if(exp){
document.form.textview.value = exp.substring(0,exp.length-1);
}
}