Following js look for the textfield q in queryform and focus it:
js:
if($("#queryform").length){
document.queryform.q.focus();
}
html:
<form id="queryform" name="queryform" action="" method="post"><input type="text" name="q" /></form>
current function
In chrome: textfield is found and focused and text is highlighted
In FF and IE: textfield is focused and marker is placed at the back
wanted function
Same in all browsers: textfield is focused, text not highlighted, marked at the end of the text
jquery
I already use jquery on the site so a neat jquery solution is preferable