jQuery focus function not working in Firefox


I was having trouble while make focus on an HTML element using jQuery in a validation fucntion but the focus() was not working in Firefox. Then google out the problem and find a solution somewhere.

So here the solution for "jQuery focus function not working in Firefox" :-

function sampledFunction()
{
window.setTimeout(function ()
{
$('#mobileno').focus();
}, 0);
return false;
}

A timer with a count of 0 will run when the thread becomes idle. Hope it will help. :-)

No comments

Powered by Blogger.