<span id="Show">内容</span><script>
document.getElementById("Show").focus();
</script>

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <script language="JavaScript" type="text/JavaScript">
    function init()
    {
    alert("load");
    document.getElementById("2").focus();
    }
    </script><body onload="init()">
    <p><a href="#" id="1">ddd</a></p>
    <p><a href="#" id="2">fff </a></p>
    </body>
    </html>这样写可以吗,怎么没有出现我想要的效果,好像焦点还是没有设置到链接上啊
      

  2.   

    可以的---------
    欢迎使用万能的代码生成工具www.bz2008.com,适应各类开发平台,注册就可使用