Guest 2.3K 9th Jan, 2019
<!DOCTYPE html> <html> <head> <script > function insert(num){ document.casio.view.value = document.casio.view.value + num } function equal(){ var exp = document.casio.view.value; if(exp){ document.casio.view.value = eval(exp) } } function clean(){ document.casio.view.value = ""; } function back(){ var exp = document.casio.view.value; document.casio.view.value = exp.substring(0,exp.length - 1); } </script> <style> *{ margin: 0; padding: 0; } .button { width: 50px; height: 50px; font-size: 25px; margin: 2px; cursor: pointer; background: #607d8b; border: none; color: white; } .view{ width: 211px; margin: 5px; font-size: 25px; padding: 5px; border: none; } .main{ position: absolute; top: 50%; left: 50%; transform: translateX(-50%)translateY(-50%); } .bg{ background: linear-gradient(to right ,#e91e63,#2c07ce); height: 1080px; width: 1920x; } </style> </head> <body> <div class="bg"></div> <div class="main"> <form name= "casio"> <input class="view" name="view"> </form> <table> <tr> <td><input class="button" type="button" value="C" onclick="clean()"></td> <td><input class="button" type="button" value="<-" onclick="back()"></td> <td><input class="button" type="button" value="%" onclick="insert('%')"></td> <td><input class="button" type="button" value="/" onclick="insert('/')"></td> </tr> <tr> <td><input class="button" type="button" value="7" onclick="insert(7)"></td> <td><input class="button" type="button" value="8" onclick="insert(8)"></td> <td><input class="button" type="button" value="9" onclick="insert(9)"></td> <td><input class="button" type="button" value="*" onclick="insert('*')"></td> </tr> <tr> <td><input class="button" type="button" value="4" onclick="insert(4)"></td> <td><input class="button" type="button" value="5" onclick="insert(5)"></td> <td><input class="button" type="button" value="6" onclick="insert(6)"></td> <td><input class="button" type="button" value="-" onclick="insert('-')"></td> </tr> <tr> <td><input class="button" type="button" value="1" onclick="insert(1)"></td> <td><input class="button" type="button" value="2" onclick="insert(2)"></td> <td><input class="button" type="button" value="3" onclick="insert(3)"></td> <td><input class="button" type="button" value="+" onclick="insert('+')"></td> </tr> <tr> <td colspan="2"><input class="button" style="width: 110px" type="button" value="0" onclick="insert(0)"></td> <td><input class="button" type="button" value="." onclick="insert('.')"></td> <td><input class="button" type="button" value="=" onclick="equal()"></td> </tr> </table> </div> </body> </html>
No description