Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-08-2013, 02:58 PM   PM User | #1
leonight
New to the CF scene

 
Join Date: Feb 2013
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
leonight is an unknown quantity at this point
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
leonight is offline   Reply With Quote
Old 02-08-2013, 03:09 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 941
Thanks: 7
Thanked 95 Times in 95 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is offline   Reply With Quote
Users who have thanked WolfShade for this post:
leonight (02-08-2013)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:18 PM.


Advertisement
Log in to turn off these ads.