把网页的焦点设置到一个指定的链接上

来源:互联网 发布:淘宝橙色rgb 编辑:程序博客网 时间:2024/05/10 05:24
<!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>