Hi all!
Is there a javascript command that can put the focus on a link?
I've tried the .focus() command and it doesn't work
Thanks
Printable View
Hi all!
Is there a javascript command that can put the focus on a link?
I've tried the .focus() command and it doesn't work
Thanks
Strange, that should be the way to do it. Try this code and run it in your browser...
Code:<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function setFocus(){
document.getElementById('test2').focus()
}
//-->
</script>
</head>
<body>
<a id="test" href="">test</a>
<a id="test2" href="">test2</a>
<div onclick="setFocus();">Click Me</div>
</body>
</html>