$('#button').click(function()
{
if ($('#the input').val().trim().length === 0)
{
$('#input to fill').focus();
$('#message').text('the input is empty').show();
return false;
}
else if ($('#the another input').val().trim().length === 0)
{
$('#input to fill').focus();
$('#message').text('the input is empty').show();
return false;
}
}
Is with a button click and when try to focus on not filled input then skip to next else if rule and display second text and do nothing about focus any idea why?
Thanks