Forum Moderators: open
<form action="" id="search" method="post">
<div>
<input id="search" maxlength="50" size="9" tabindex="1" type="text" value="" />
<input class="button" type="submit" value="Search" />
</div>
</form><script language="JavaScript">
<!--
document.getElementById('query_string').focus();
document.search.query_string.focus();
//-->
</script>
Now there are two lines that both work in Gecko/IE/Opera. I put both in just so we had more then one option.
Now what I'm trying to do is get this script out of the body completely. I have a <script src="" in the head from which I want this to be able to work from. I don't want to use the body element with any javascript attributes either.
So can someone help me get this working? :)
There is a decent tutorial by Simon Willison at this site...
[sitepoint.com...]
I ended up using the more advanced onload script towards the bottom of page one and it works like a charm. IE 5.01,5.5,6.0, Opera 7.54.,8.5,9.0, and Gecko 1.8.