Is there anyway I can check if an input is empty using javascript and then run a function? I'd like it to be in the input itself if possible.
There is onChange
so is there an ifEmpty
lol?
Is there anyway I can check if an input is empty using javascript and then run a function? I'd like it to be in the input itself if possible.
There is onChange
so is there an ifEmpty
lol?
Try this
function a(e)
{
if(e.value=="")
return false;
else
console.log('there is a value')
}
<input value="" onclick="a(this)">