<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jquery自动打开第一个链接_www.jb200.com</title>
<script language="
javascript" type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var url = $("a").attr("href");
alert("第一个的地址为:" + url);
window.location.href = url;
});
</script>
</head>
<body>
<a href="http://www.jb200.com">
脚本学堂</a>
<a href="link2">link2</a>
<a href="link3">link3</a>
<a href="link4">link4</a>
<a href="link5">link5</a>
<a href="link6">link6</a>
<a href="link7">link7</a>
<a href="link8">link8</a>
<a href="link9">link9</a>
<a href="link10">link10</a>
</body>
</html>