I have this code:
function beforemouseout() {
if ($(this).val() == '') {
$(this).val($(this).attr('title'));
}
else {
}
setTimeout('beforemouseout()',3000);
}
$(".other").click(function() {
$(this).val('');
$(".other").mouseout(beforemouseout);
});
<input id="hour" type="text" class="other" autocomplete="off" value="hour" title="hour" />
<input id="hour" type="text" class="other" autocomplete="off" value="minutes" title="minutes" />
But Firebug gives me an error: beforemouseout is not defined. Why? I tried it on jsfiddle.net and it doesn't give an error , but the result is not what I expected.I expected when i click on #hour to hide the text and when onmouseout is triggered to wait 5 second and then - to do the checks