I'm trying erasing the last character on the "backspace" field when I'm clicking on "button" field.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<span id="log">abcdefghijklmnop</span>
<div class="button" id="backspace">Backspace</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(function (){
// backspace
$( "#backspace" ).on( "click", function() {
$('#logInfo').hide();
$("#log").text().substr(0,this.length-1);
});
});
</script>
</body>
</html>