jQuery
<div id="aa"></div>
<div id="aa"></div>
<div id="aa"></div>
<div id="aa"></div>
想用jquery获得第二个值怎么获得
用$("aa").get(1).value有可能获得,不过不稳定
[解决办法]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title> new document </title>
<meta name="keywords" content="">
<meta name="description" content="">
<script type="text/javascript" src="js/jq.js"></script>
</head>
<body>
<div id="aa">1</div>
<div id="aa">2</div>
<div id="aa">3</div>
<div id="aa">4</div>
<script type="text/javascript">
<!--
$(document).ready(function(){alert($("div[id=aa]:eq(1)").html())})
//-->
</script>
</body>
</html>
[解决办法]
$("div").get(1).html();
[解决办法]