THAPA TECHNICAL

HOUSE OF WEB DEVELOPERS AND TECHNOLOGY.

Create a simple Calculator using JavaScript HTML and CSS





A calculator is a device that performs arithmetic operations on numbers. The simplest calculators can do only addition, subtraction, multiplication, and division. More sophisticated calculators can handle exponential operations, roots, trigonometric functions, and hyperbolic functions.

Here is the source code, Have a great day and plz share this video to all your friends and don't forget to subscribe my channel  :) 




<code>

<style>
.formstyle{
 width:250px;
 height:390px;
 margin:auto;
 border:2px solid black;
}

input{
 width:80px;
 height:40px;
 background-color:blue;
 font-size:30px;
 color:white;
 border-bottom:1px solid black;

}

#finalanswer{
 width:250px;
}
#clearbutton{
 width:250px;
}

</style>

</code></div>
<body>
<div class="formstyle">
<form name="formCalci">

<input id="finalanswer" name="answers" type="text" /> <br />

<input onclick="formCalci.answers.value += '1' " type="button" value="1" />
<input onclick="formCalci.answers.value += '2' " type="button" value="2" />
<input onclick="formCalci.answers.value += '3' " type="button" value="3" />


<br />

<input onclick="formCalci.answers.value += '4' " type="button" value="4" />
<input onclick="formCalci.answers.value += '5' " type="button" value="5" />
<input onclick="formCalci.answers.value += '6' " type="button" value="6" />


<br />

<input onclick="formCalci.answers.value += '7' " type="button" value="7" />
<input onclick="formCalci.answers.value += '8' " type="button" value="8" />
<input onclick="formCalci.answers.value += '9' " type="button" value="9" />

<br />

<input onclick="formCalci.answers.value += '+' " type="button" value="+" />
<input onclick="formCalci.answers.value += '-' " type="button" value="-" />
<input onclick="formCalci.answers.value += '/' " type="button" value="/" />

<br />

<input onclick="formCalci.answers.value += '0' " type="button" value="0" />
<input onclick="formCalci.answers.value += '*' " type="button" value="*" />
<input onclick="formCalci.answers.value = eval(formCalci.answers.value) " type="button" value="=" />
<br />

<input id="clearbutton" onclick="formCalci.answers.value = '' " type="button" value="Clear All" />

</form>

</div>
</code>

Here are other videos on How to create a Windows 10 Calculator Hope you will love it.

➡️ Source Code Link: https://www.thapatechnical.com/2019/08/how-to-get-source-code.html


6 comments: