Forum Moderators: open
document.getElementById('an_element').focus();
How can we give an anchor element focus without IE crying about errors?
- John
window.onload = myFunctionfunction myFunction() {document.getElementById('an_element').focus();}
function myFunction() {document.getElementById('an_element').focus();}
with HTML <a tabindex="0" id="an_element" href="page.htm" onfocus="alert('focus');">Page</a>
Works for me in IE 6
[edited by: XtendScott at 5:28 pm (utc) on Oct. 23, 2007]
It's an error with jQuery in IE6... dragging the layer via it's h2 element.
$(document).ready(function() {$('#prompts').Draggable({containment : 'parent', ghosting: true, opacity: 0.5, fx: 300, handle: '#promptsspan', zIndex: 1000,});});