JSFiddle - React, Tailwind, and code Playground

by Manoj kumar Lakshman

HTML

<input type="text" />

JavaScript

$(document).ready(function () {
    $('input').keyup(function () {
        var $th = $(this);
        $th.val($th.val().replace(/[-]/g, function (str) {
            //alert('You typed " ' + str + ' ".\n\nPlease use only letters and numbers.'); 
           
            return ''; 
        }));
        $('input')[0].setSelectionRange(0, 0)
    });
});