Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <input type="text" id="n1"/><br/><br/>
  2.         <input type="text" id="n2"/><br/><br/>
  3.  
  4.  <button onclick="calc();">=</button>
  5.         <input type="text" id="result"/>
  6.  
  7. THIS IS FOR JS
  8.  
  9.  function calc()
  10.             {
  11.                 var n1 = parseFloat(document.getElementById('n1').value);
  12.                 var n2 = parseFloat(document.getElementById('n2').value);
  13.  
  14.  document.getElementById('result').value = n1+n2;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement