"Simple Calcultor in javascript "
Bootstrap 4.0.0 Snippet by ayaz11244

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My Calcultor</title> </head> <body> <br /> <br /> <center> <form name="calc"> <input type="text" value="" name="dd" size="15px"/><br /> <input type="button" value="1" onclick="first()" /> <input type="button" value="2" onclick="sec()" /> <input type="button" value="3" onclick="third()" /> <input type="button" value="4" onclick="fourth()" /><br/> <input type="button" value="5" onclick="fifth()" /> <input type="button" value="6" onclick="sixth()" /> <input type="button" value="7" onclick="seven()" /> <input type="button" value="8" onclick="eight()" /><br /> <input type="button" value="+" onclick="plus()" /> <input type="button" value="=" onclick="equal()" /> <input type="button" value="-" onclick="minus()" /> <input type="button" value="*" onclick="divid()" /><br /> <input type="button" value="/" onclick="sub()" /> <input type="button" value="0" onclick="zeroo()" /> <input type="button" value="c" onclick="clr()" /> </form> </center> </body> </html>
function first(){ document.calc.dd.value+="1"; } function sec(){ document.calc.dd.value+="2"; } function third(){ document.calc.dd.value+="3"; } function fourth(){ document.calc.dd.value+="4"; } function fifth(){ document.calc.dd.value+="5"; } function sixth(){ document.calc.dd.value+="6"; } function seven(){ document.calc.dd.value+="7"; } function eight(){ document.calc.dd.value+="8"; } function plus(){ document.calc.dd.value+="+"; } function minus(){ document.calc.dd.value+="-"; } function divid(){ document.calc.dd.value+="*"; } function sub(){ document.calc.dd.value+="/"; } function zeroo(){ document.calc.dd.value+="0"; } function equal(){ document.calc.dd.value= eval(calc.dd.value); } function clr(){ document.calc.dd.value = ""; }

Related: See More


Questions / Comments: