click anywhere to assign element focus
click anywhere on the document to put focus on an element NOT currently working because I yanked out jQuery & didn't have time to finish... and didn't work as easily without...
by Matt Rummler
HTML
<input name="q" type="text" />
JavaScript
var bodyVar=document.querySelector('body');
bodyVar.onclick=clickFunction;
function clickFunction()
{
alert('the click function was called');
// var inputElement=document.querySelector('input[name="q"]');
// inputElement.focus();
};