Javascript - can it only return false?
If I delete -
else
{
alert('Keyword has accepted');
return true;
}
, whole code wont work.
function required(look_for)
{
var empt = look_for;
if (empt.value.length == 0)
{
alert("Please input a Keyword");
return false;
}
else
{
alert('Keyword has accepted');
return true;
}
}
It's probable that it should be empt.length not empt.value.length
This depends on what you send to the function, I assume you sent a string