Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to get a result in the input form

<HTML>
      <HEAD>
        <TITLE>Sum</TITLE>

        <script type="text/javascript">
          function sum()
          {

             var num1 = document.myform.number1.value;
             var num2 = document.myform.number2.value;
             var sum = parseInt(num1) + parseInt(num2);
             document.getElementById('add').value = sum;
          }
        </script>
      </HEAD>

      <BODY>
        <FORM NAME="myform">
          <INPUT TYPE="text" NAME="number1" VALUE=""/> + 
          <INPUT TYPE="text" NAME="number2" VALUE=""/>
          <INPUT TYPE="button" NAME="button" Value="=" onClick="sum()"/>
          <INPUT TYPE="text" ID="add" NAME="result" VALUE=""/>
        </FORM>

      </BODY>
</HTML>
Comment

PREVIOUS NEXT
Code Example
Html :: dijit/form/Textarea 
Html :: nepal location 
Html :: html.raw to list model 
Html :: inclure html ds html avec <object 
Html :: thymeleaf optional fragment parameter 
Html :: create a string of 1024 characters 
Html :: is colby cool 
Html :: text html 
Html :: typo3 fluid form input text 
Html :: empty pre-selected option html 
Html :: html film structure 
Html :: how to add vertical space between two text boxes in html 
Html :: run html file from terminal 
Html :: convert markdown to styled html 
Html :: fix character wpf missing 
Html :: HRECURS - Hello Recursion 
Html :: hCards 
Html :: how many mammals live in water a few,many,much 
Html :: error pop writing html 
Html :: image code 
Html :: wordpress to static html 
Html :: elementos linea html 
Html :: Full Form Of RAR 
Css :: make image not draggable css 
Css :: css get rid of button outline on click 
Css :: button background color remove 
Css :: linear gradient instagram 
Css :: ion input padding left 
Css :: tailwindcss forms plugin 
Css :: css image fit in div with aspect ratio 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =