Hello,
I have a html page with an anchor in the middle of the page:
<a name='dana' id='dana'>set focus...</a>
I would like to set the focus of the page to that anchor when the page
loads.
I'm trying to do that by calling an init() function when the page loads and
there to set the focus on the element:
document.getElementById("dana").focus();
This doesn't work...
Any ideas?
Thanks,
Dana
Ben Dewey - 20 Dec 2005 16:54 GMT
why can't you just do a redirect to mypage.aspx#dana.
if you must use javascript:
function init()
{
window.location.href = window.location.href + "#dana";
}