jquery使用属性相等选择器
2010-09-14 13:08:45 来源:WEB开发网[示例代码]<html>
<head>
<script src="jquery-1.2.js"></script>
<script>
$(document).ready (
function () {
$("a[@href='http://www.goumin.com/']").each (
function (index, element) {
$(element).css("background-color", "yellow");
}
);
}
);
</script>
</head>
<body>
<a href="http://www.goumin.com/">
http://www.goumin.com/
</a>
<a href="http://blog.csdn.net/hu_zhenghui">
http://blog.csdn.net/hu_zhenghui
</a>
<a href="http://www.goumin.com/">
http://www.goumin.com/
</a>
<a href="http://blog.csdn.net/hu_zhenghui">
http://blog.csdn.net/hu_zhenghui
</a>
<a href="http://www.goumin.com/">
http://www.goumin.com/
</a>
<a href="http://blog.csdn.net/hu_zhenghui">
http://blog.csdn.net/hu_zhenghui
</a>
</body>
</html>
更多精彩
赞助商链接