JSFiddle - React, Tailwind, and code Playground

by Dedi Wibisono

HTML

<input type="text" id="namaLengkap">

JavaScript

$("#namaLengkap").on("keypress keyup blur",function (event){
   $(this).val($(this).val().replace(/^(?=.*?[1-9])[0-9()-]+$/, ""));
});