jQuery Style - 如何根據(jù)里面的類改變風(fēng)格
我們想知道如何根據(jù)里面的類改變風(fēng)格。
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(".blockcontent .advertisement").parent().css({background: "red"});
});
</script>
</head>
<body>
<div class="defaultblock">
<div class="blockcontent">
<div id="group-id-tids-11" class="advertisement">Inner content</div>
</div>
</div>
</body>
</html>
The code above is rendered as follows: