JQuery - 逗号的应用

<html>
<head>
<title>Select mutiple elements example</title>
 
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
 
</head>
<script type="text/javascript">
 
$(document).ready(function(){
 
	$(".p1, .p3, #div3").css("border", "2px solid red");
 
});
 
</script>
<body>
 
<h1>Select mutiple elements example</h1>
 
<p class="p1">P1</p>
<p class="p2">P2</p>
<p class="p3">P3</p>
<p class="p4">P4</p>
 
<div id="div1">DIV1</div>
<div id="div2">DI2</div>
<div id="div3">DI2</div>
<div id="div4">DI2</div>
 
</body>
</html>




你可能感兴趣的:(JQuery - 逗号的应用)