JSFiddle - React, Tailwind, and code Playground
HTML
<p>Backspace</p>
<input type="text" id="in" value="This is text." />
JavaScript
$('p').click(function()
{
var text = $('#in').val();
$('#in').val(text.substring(0, (text.length -1)));
});