element
匹配页面中所有element元素,返回匹配后结果集
<!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(){
$("div").css("border","3px solid red");
});
</script>
<style>
div,span {
width: 60px;
height: 60px;
float:left;
padding: 10px;
margin: 10px;
background-color: #EEEEEE;
}
</style>
</head>
<body>
<div>DIV1</div>
<div>DIV2</div>
<span>SPAN</span>
</body>
</html>
$("div").css("border","3px solid red")将匹配页面中所有的<div></div>,然后加上样式。