JSFiddle - React, Tailwind, and code Playground

by Arun Prasad 9946146920

HTML

<html>

<script>

function myFunction() {
  var y =parsefloat( document.getElementById("txt1").value);
  var z =parsefloat( document.getElementById("txt2").value);
  var s =parsefloat(document.getElementById("txt3").value);
  var x = y + z + s;
  document.getElementById("demo").innerHTML = x;
}
      
</script>



<p>
  Click the button to calculate x.
  <button onclick="myFunction()">Try it</button>
</p>
<p>
  Enter first number:
  <input type="text" id="txt1" name="text1" value="1">
  Enter second number:
  <input type="text" id="txt2" name="text2" value="2">
  enter third number:
  <input type="text" id="txt3" name="text3" value="3">
</p>
<p id="demo"></p>






</html>