[text] Very complicated

Viewer

copydownloadembedprintName: Very complicated
  1. <!DOCTYPE html>
  2. <html>
  3.         <head>
  4.                 <title>Uppgift Javascript, Rexi Flatöe</title>
  5.         <meta charset="utf-8"/>
  6.                 <script type="text/javascript">
  7.                         function addTwoNumbers(textBox1, textBox2){
  8.                                 var x=document.getElementById(textBox1).value;
  9.                                 var y=document.getElementById(textBox2).value;
  10.                                 var sum=0;
  11.                                 sum=Number(x)+Number(y);
  12.                                 alert("Summan är: " + sum);
  13.                         }
  14.                 </script>
  15.         </head>
  16. <body>
  17.  
  18.     <h2>Addera två nummer.</h2>
  19.         <b>Skriv första numret: </b><br>
  20.         <input type="text" id="textIn1"/><br>
  21.         <b>Skriv andra numret: </b><br>
  22.         <input type="text" id="textIn2"/><br><br>
  23.         <input type="button" id="btnSum" value="Räkna ut" onClick="addTwoNumbers('textIn1','textIn2')"/>
  24.  
  25. </body>
  26.  
  27. </html>

Editor

You can edit this paste and save as new:


File Description
  • Very complicated
  • Paste Code
  • 30 Nov-2021
  • 732 Bytes
You can Share it: