JSFiddle - React, Tailwind, and code Playground

by bvotcode

HTML

<input type="number" id="problem1" value="1000"/>
<button id="problem1button">Submit</button>

<p>Result is: <span id="result"></span></p>

JavaScript

var problem1El = document.getElementById("problem1");
document.getElementById("problem1button").addEventListener("click", findSum);

function findSum(){
  var v = problem1El.value;
  document.getElementById("result").innerHTML = v;
}