Q&A for How to Create a Calculator Using HTML

Return to Full Article

Search
Add New Question
  • Question
    Do I need to be connected to the internet?
    Community Answer
    Usually, HTML will run in your browser, even without an internet connection.
  • Question
    How can I get more space between the buttons?
    Community Answer
    If you are using HTML, you can add  in the cells to add extra padding or the CSS code button.
  • Question
    What do I do if this code is not working for me?
    Community Answer
    The code will certainly work. If it is not working for you, then there might be some errors in your code. Just copy and paste the above code and follow all the procedures, and it should work fine.
  • Question
    After I modify the code, can I distribute it freely?
    Community Answer
    Yes. These are simple codes for educational purposes; no one owns the rights for these codes.
  • Question
    How can I make the buttons larger?
    Community Answer
    You can make the button size bigger by using the CSS tag. For eg:.button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; font-size: 16px; margin: 4px 2px;}
  • Question
    What does the reset button do?
    Community Answer
    Nothing, it just redoes your whole equation, basically erasing the information you had on there.
  • Question
    Is there a way to make custom buttons on this script?
    Community Answer
    Definitely. You can use CSS styling or attach background images to the button. You can also use the HTML canvas tag with Javascript to create.
  • Question
    Can I create a calculator in normal notepad?
    Community Answer
    Yes, but it won't be as good as if you use other coding languages, like HTML or Javascript.
  • Question
    How do I make the buttons larger when making a calculator using HTML? How do I add CSS or JS tags?
    Community Answer
    To make the button larger, we use CSS tags. In the body, type and on a new line type . In between them, type: .classname { width: 50%; padding: 50px 50px; font-size: 30px; text-align: center; } change the padding, with and font-size to whatever you want. Then go to the buttons. Inside the tag for each button, type class="classname"
  • Question
    What do I do if the buttons aren't working on the calculator?
    Community Answer
    If you copied the code, try doing it again. If you coded it, then check the input variables and the conditionals.
  • Question
    How can I change it to read numeric keypad input?
    A_random_reader
    Community Answer
    Insert this script tag: var x = document.getElementsByTagName('input')[16]; x.onkeydown = function(e) { y = x - 49; document.getElementsByTagName('input')[y].click(); }
  • Question
    How can I insert a border?
    A_random_reader
    Community Answer
    Drop a style tag into your HTML: input[type=button],input[type=submit],input[type=reset]{ border:1px solid black; }
  • Question
    Can I upload it to my website?
    A_random_reader
    Community Answer
    You can, as long as you have a good hosting provider that lets you upload files. A drag-and-drop website builder can't do this.
  • Question
    Can I also add operations like square root and hiw?
    Stockriderj
    Community Answer
    Yes, but that would require you to code them yourself. You'd have to learn JavaScript to do that.
  • Question
    I have done that in HTML but i have a problem when I push the + and - button inside in the calculator so they are pushing more then one + inside in the calculator. What should I do?
    Stockriderj
    Community Answer
    You may have forgotten to close one of the elements. That happens lots of times. Professional web developers close them immediately so they don't forget.
  • Question
    How can I add functions to it for it to be able to solve a question?
    Community Answer
    For functions I'm assuming mathematical functions such as trigonometric functions, etc. You can implement Javascript into HTML easily, and utilise mathematical function operations such as Math.sin() found in Javascript code.
Ask a Question

      Return to Full Article