jquery attribute$=value选择器 语法
jquery attribute$=value选择器 语法
作用:[attribute$=value] 选择器选取每个带有指定属性且以指定字符串结尾的元素。
语法:$("[attribute$=string]"
参数:attribute 必需。规定要查找的属性。 string 必需。规定属性值以其结尾的字符串。 直线电机参数
jquery attribute$=value选择器 示例
<html>
<head>
<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("[id$=header]").css("background-color","#B2E0FF");
});
</script>
</head>
<body>
<html>
<body>
<h1 id="main_header">Welcome to My Homepage</h1>
<p class="intro">My name is Donald</p>
<p>I live in Duckburg</p>
<p>My best friend is Mickey</p>
<h3 id="sub_header">My uncle is Scrooge</h3>
<div id="choose">
Who is your favourite:
<ul>
<li>Goofy</li>
<li>Mickey</li>
<li>Pluto</li>
</ul>
</div>
</body>
</html>
</body>
</html>
浙公网安备 33010602011771号