Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    starter javascript calculator help

    Code:
    <!DOCTYPE html>
    <html>
    
    
    <head>
    
    <script>
    function kis()
    {
    var a=Number(document.getElementById("txt1").value);
    var b=Number(document.getElementById("txt2").value);
    var result=a+b;
    document.getElementById("txt3").innerHTML=result;
    }
    </script>
    </head>
    <body>
    <input id="txt1" type="text" >
    <input id="txt2" type="text" >
    <input id="txt3" type="text" >
    <input  type="button" value="submit"  onclick="javascript:kis();">
    
    
    </body>
    </html>
    i can't find out what i am doing wrong here

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    document.getElementById("txt3").value=result;
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • Users who have thanked WolfShade for this post:

    leonight (02-08-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •