JSFiddle - React, Tailwind, and code Playground

by consultcory

HTML

<input id="inputID" type="text" value="" maxlength="11" />

JavaScript

var hw = "hello world";
$('#inputID').keydown(function (e) {
    if (e.which !== 8) {
        e.preventDefault();
        this.value += ' ';
    }
}).keyup(function () {
    this.value = hw.substring(0, this.value.length);
});