JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="txt" onchange="if(!this.value.match(/^\D*0(\D*\d){9}\D*$/)) {alert('Phone Number is Invalid');}"/>