JSFiddle - React, Tailwind, and code Playground

by austinmillett

HTML

Enter Value 1:
<input type = "text" id = "value1"/><br>
Enter Value 2:
<input type = "text" id = "value2"/><br><br>
<input type = "button" id = "submit" value = "Submit" onclick = "addValues()"/><br><br>
Result:
<input type = "text" id = "value3"/>

JavaScript

function addValues() {
var value1 = parseInt(document.getElementById("value1").value);
var value2 = parseInt(document.getElementById("value1").value);
var result = value1 + value2;
document.getElementById("value3").value = result;
}