I'm trying to set the focus on a text input element using
document.getElementById( 'id' ).focus()
This works in Firefox 3, but does not work in Internet Explorer 8.
What is the correct way to set focus on an HTML element in Internet Explorer?
I'm trying to set the focus on a text input element using
document.getElementById( 'id' ).focus()
This works in Firefox 3, but does not work in Internet Explorer 8.
What is the correct way to set focus on an HTML element in Internet Explorer?
Are you sure there isn't another problem with your code? I don't have an IE8 to test with, but this self-contained example works perfectly in IE7 - perhaps you could try it in IE8?
<html><body>
<form><input type='text' id='bim'></form>
<script>document.getElementById('bim').focus()</script>
</body></html>