Thursday, 19 September 2013

focus() not firing the focus event when called from jQuery(document).ready

focus() not firing the focus event when called from jQuery(document).ready

I have a page with a large form on it and I am trying to assign the form
element that has focus when the page loads. It appears to be working in
that the cursor is place in the selected form element, however, the focus
event is not fired. If I minimize the browser and then maximize it again
the focus event is then fired, but not on jQuery(document).ready(). Any
advice appreciated...
jQuery(document).ready(function()
{
console.log("call focus");
jQuery("#tbl_Employees").find(".employeeinfo:eq(" + IndexEmp +
")").find("tr#trSequence").find("td:eq(5)").children(":first").focus();
});
jQuery(":input").focus(function(e)
{
console.log("enter focus");
});

No comments:

Post a Comment