attr("class")是指获得CSS中的.red中的color值吗??
<!DOCTYPE html>
<html>
<head>
<title>.class选择器</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="red">我穿红衣了</div>
</body>
<script type="text/javascript">
var $className=$(".red").attr("class");
// $(".red").html($className)
document.write($className)
</script>
</html>