JSFiddle - React, Tailwind, and code Playground

HTML

<input type='text' id='testBox'/>

JavaScript

$(document).on('keyup','#testBox', function(event){

    var input = event.currentTarget.value;
    
    if(input.search(/^0/) != -1){
         alert("you have started with a 0");   
    }
});