Extension:Gadgets/Scripts/SearchFocus.js

From MediaWiki.org
Jump to navigation Jump to search
// Imported from http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js as of June 4, 2009
if (
	wgPageName == 'Main_Page' ||
	typeof( wgMainPageTitle ) != 'undefined' && wgPageName == wgMainPageTitle
)
{
	addOnloadHook( function() {
		document.getElementById( 'searchInput' ).focus();
	});
}