Input HTML Hindari spasi pra
function validate(input){
if(/^\s/.test(input.value))
input.value = '';
}
Weary Wildebeest
function validate(input){
if(/^\s/.test(input.value))
input.value = '';
}
<input id='noWhiteSpaceAtTheStart' oninput="validate(this)" type='text'/>
Run code snippetHide results