Hi, I have the following piece of code for a Google Custom Search Engine, but I can't figure out how to automatically focus to the search box. Any ideas, or if it's possible? Cheers <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('mysiteid'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); options.enableSearchboxOnly("http://www.mysite.com/"); customSearchControl.draw('cse-search-form', options); }, true); </script> Code (markup):
You can't and this is why: This code probably displays the search form as a iframe and you can't access the document object inside the iframe from the document that holds the iframe
Sorry but I don't understand... I guess what I'm after is this - if you look at the Google homepage the cursor's focussed on the search box automatically.