using Jquery/javascript
Is it: $(document).focus()?
using Jquery/javascript
Is it: $(document).focus()?
$().method() fires the listeners associated with that method. If you need to call functions on dom elements, index the jQuery object.
i.e.
$(document)[0].focus()
Although why you wouldn't just use document.focus is probably a question worth answering.
The .focus() method on a jQuery-wrapped element will bind to the onfocus event if a function is passed as the first parameter, or trigger attached event handlers with no parameter.
I'm not sure why you're trying to do what you're trying to do, but if you're trying to blur the currently active element, no matter what element it is, you can use:
if ("activeElement" in document)
document.activeElement.blur();
This isn't advised though, as doing so will reset the tabbing order and potentially annoy keyboard-navigating users.