JSFiddle - React, Tailwind, and code Playground

by kangismet

HTML

<textarea id="comment" cols="50" rows="10">Silahkan isi komentar anda</textarea>
<input type="button" onclick="backspace();" value="backspace" />

CSS

textarea {
  display:block;
  margin-bottom:20px;
}

JavaScript

var backspace = function() {
 var math  = document.getElementById('comment').value;
 document.getElementById('comment').value=math.substring(0,math.length -1);
}