1. Create Required File
First, we are creating the required file for our calculator. First, you create a folder in a specific place. Now we are creating three HTML, CSS, and js files in a folder.
2. Link CSS and JS
Now we link the CSS and js on HTML. First, we link the CSS: <link rel="stylesheet" href="style.css">. And then link the JS on HTML. <script src="script.js"></script>
3. Create Layout With HTML
We are creating the layout of the calculator with HTML. Our calculator contains a display, AC, DEL, Numbers, Equal to, divide, multiply, minus, and plus. Use this code
4. Style with CSS
Now it's time to style the calculator with CSS. There we can give our HTML as a calculator shape. We already create a CSS file as a style.css.
3. Add function with js
Now it's time to make our calculator functional. We are used the script.js file to write js code. If you are a beginner then you are confused about js code. But don't worry I will provide complete code which you can embed on the text editor. We are make working functions such as plus, minus, divide, multiply, equal to, AC(All Clear), DEL, and more. There is the basic function of a simple calculator.