I need help with my calculator

I am trying to make a custom calculator. Basicallt I want the answer for Number 1 + answer for Number 2 then show up in Results after clicking the Show Results button. It won’t work and I don’t know why.


    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">


    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link rel="stylesheet" href="style.css">

    <style type="text/css">





    <div class="container">

        <h2>Kovaak's Sensetivity Converter</h2>



            <div class="inputfield">

                <input type="text" name="txtnum1" required="">

                <label>Number 1</label>





            <div class="inputfield">

                <input type="text" name="txtnum2" required="">

                <label>Number 2</label>






            <div class="inputfield">

                <input type="text" name="txtres" required="">





        <input type="button" value="Show Results" class="btn"  onClick="sumValues()">


    <script type="text/javascript">

        function sumValues()


            var num1, num2, res;







    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>

    <script type="text/javascript"></script>


Hi @synaric and welcome,

From the code you’ve posted I see you are trying to make a plain HTML/CSS calculator, is that right?

This forum is dedicated to providing support to users creating and working on Playcanvas related projects. If you don’t plan in expanding this calculator to work on Playcanvas you may have better luck asking this question on stackoverflow.


nvm i figured it out

1 Like