HTML Codes for making Working Calculator at Home😎😁

Hello everyone Today we are back with a topic “How to make calculator at home with HTML CODING”






         //function that display value

         function dis(val)





         //function that evaluates the digit and return result

         function solve()


             let x = document.getElementById(“result”).value

             let y = eval(x)

             document.getElementById(“result”).value = y



         //function that clear the display

         function clr()


             document.getElementById(“result”).value = “”



      <!– for styling –>



         margin-bottom: 10px;


         width: 210px;


         border: solid black 2px;





         color: black;

         border: solid black 2px;






         border: solid black 2px;





   <!– create table –>


      <div class=”title”>
Inventips Calculator</div>
<table border=”1″>

            <td colspan=”3″><input id=”result” type=”text” /></td>

            <!– clr() function will call clr to clear all value –>

            <td><input onclick=”clr()” type=”button” value=”c” /> </td>


            <!– create button and assign value to each button –>

            <!– dis(“1”) will call function dis to display value –>

            <td><input onclick=”dis(‘1’)” type=”button” value=”1″ /> </td>

            <td><input onclick=”dis(‘2’)” type=”button” value=”2″ /> </td>

            <td><input onclick=”dis(‘3’)” type=”button” value=”3″ /> </td>

            <td><input onclick=”dis(‘/’)” type=”button” value=”/” /> </td>


            <td><input onclick=”dis(‘4’)” type=”button” value=”4″ /> </td>

            <td><input onclick=”dis(‘5’)” type=”button” value=”5″ /> </td>

            <td><input onclick=”dis(‘6’)” type=”button” value=”6″ /> </td>

            <td><input onclick=”dis(‘-‘)” type=”button” value=”-” /> </td>


            <td><input onclick=”dis(‘7’)” type=”button” value=”7″ /> </td>

            <td><input onclick=”dis(‘8’)” type=”button” value=”8″ /> </td>

            <td><input onclick=”dis(‘9’)” type=”button” value=”9″ /> </td>

            <td><input onclick=”dis(‘+’)” type=”button” value=”+” /> </td>


            <td><input onclick=”dis(‘.’)” type=”button” value=”.” /> </td>

            <td><input onclick=”dis(‘0’)” type=”button” value=”0″ /> </td>

            <!– solve function call function solve to evaluate value –>

            <td><input onclick=”solve()” type=”button” value=”=” /> </td>

            <td><input onclick=”dis(‘*’)” type=”button” value=”*” /> </td>



HAPPY CODING😎😎😎😎😎🇮🇳🇮🇳🇮🇳

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

One Words…One Words…

PHOBIAS Fear due to height – Acrophobia (ऊंचाई से डरना) Fear due to water –hydrophobia (पानी से डरना) Fear due to public places. big or void places – Agoraphobia (public place से डर लगना)

Viewed by 500 Users शिक्षा व्यवस्था Our Most Popular article in Hindi & EngViewed by 500 Users शिक्षा व्यवस्था Our Most Popular article in Hindi & Eng

शिक्षा व्यवस्था English wala article padne ke liye niche link pr click kre  To Read Education System: Click शिक्षा व्यवस्था  हम छात्र अपना समय और पैसा शिक्षा प्रणाली में निवेश करते