<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>jquery属性过滤选择器</title>
<script src="jquery-1.8.0.js"></script>
</head>
<style type="text/css">
body{
font-size:12px;
text-align;center;
}
div{
float:left;
border:solid 1px #ccc;
margin:8px;
width:65px;
height:65px;
display:none;
}
</style>
<script type="text/javascript">
/*
$(function(){
$("div[id]").show(300);
});
$(function(){
$("div[title='A']").show(300);
});
$(function(){
$("div[title!='A']").show(300);
});
$(function(){
$("div[title^='A']").show(300);
});
$(function(){
$("div[title$='C']").show(300);
});
$(function(){
$("div[title*='B']").show(300);
});
*/
$(function(){
$("div[id='divAB'][title*='B']").show(300);
});
</script>
<body>
<div id="divID">ID</div>
<div title="A">Title A</div>
<div id="divAB" title="AB">ID <br />Title AB</div>
<div title="ABC">Title ABC</div>
</body>
</html>
jquery属性过滤选择器
最新推荐文章于 2024-11-13 22:41:38 发布