|
*
匹配所有的元素,包括head,body等等,返回匹配后的结果集
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("*").css("border","3px solid red"); }); </script> <style> div,span,p { width: 150px; height: 60px; float:left; padding: 10px; margin: 10px; background-color: #EEEEEE; } </style></head><body> <div>DIV</div> <span>SPAN</span> <p>P <button>Button</button></p></body></html>
$("*").css("border","3px solid red");
将匹配页面上所有的DOM,包括body。然后给匹配的每个元素加上样式。
|
|