jquery的add()方法扩大选择返回

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <script type="text/javascript" src="jquery-1.11.3.min.js"></script>
 6     <title>Title</title>
 7 </head>
 8 <body>
 9     <div>你好</div>
10     <p>你好</p>
11     <h1>你好</h1>
12     <script type="text/javascript">
13         $(document).ready(function(){
14             //jquery add()方法是选择更多的元素
15             $("div").add("p").add("h1").css({"width":"100px","height":"100px","background":"orange","display":"inline-table"});
16         });
17     </script>
18 </body>
19 </html>

posted @ 2016-03-08 21:22  Window2016  阅读(187)  评论(0编辑  收藏  举报