adamjblakey
Jun 19th 2007, 5:04 am
Hi,
I have a function which hides and shows a div.
When i click the link to show the the div the page loads at the top. What i want to do is keep the focus on the link.
This is what i am using but does not seem to work?
function change(which) {
document.getElementById('div1').style.display = 'block';
document.getElementById('div1').focus();
}
Here is the link: <a href="#" onclick="change('div1');">Click here</a>
Any ideas why it is not working?
I have a function which hides and shows a div.
When i click the link to show the the div the page loads at the top. What i want to do is keep the focus on the link.
This is what i am using but does not seem to work?
function change(which) {
document.getElementById('div1').style.display = 'block';
document.getElementById('div1').focus();
}
Here is the link: <a href="#" onclick="change('div1');">Click here</a>
Any ideas why it is not working?