JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="txt1" />
<input type="button" value="submit" onclick="incrvalue()" />
JavaScript
function incrvalue()
{
var ibox = document.getElementById("txt1");
if(isNaN(ibox.value)) return; // if input is not a number
var k = parseInt(ibox.value);
k = k + 1;
ibox.value = k;
}