Jump to content

Search the Community

Showing results for tags 'arithmetic opeartion'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello Gurus, I'm a beginner to the Java Script. While learning Arithmetic chapter, I just tried the below simple program. Everything is giving correct result except the addition operation. I tried my best to understand and produce the result. Could anyone point out/throw some light on what I'm doing wrong please. <!DOCTYPE html> <html> <body> <h1>Assigning Values</h1> <p>In JavaScript the = operator is used to assign values to variables.</p> <input type="number" id="a" value=5></input> <input type="number" id="b" value=1></input> <p id="+"></p> <p id="-"></p> <p id="YY"></p> <p id="*"></p> <p id="/"></p> <script> var x = document.getElementById( "a" ).value; var y = document.getElementById( 'b' ).value; //document.getElementById("+").innerHTML = "Additon - " + (x + y) + typeof x; //document.getElementById("+").innerHTML = (x + y) + " - Additon" ; //document.getElementById("+").innerHTML = x + y; document.getElementById("+").innerHTML = Number(x) + y; document.getElementById("-").innerHTML = x - y ; document.getElementById("YY").innerHTML = "Subtraction - " + x - y ; document.getElementById("*").innerHTML = "Multiplication - " + x * y; document.getElementById("/").innerHTML = "Divide - " + x / y; </script> </body> </html> Thanks in Advance. Regards, Md.Riyaz
×
×
  • Create New...