Пример:
Добавить цвет фона и цвет текста ко всем заголовкам на странице.
"HTML"
<h1>Header 1</h1>Contents 1
<h2>Header 2</h2>Contents 2
"CSS"
body { font-size: 10px; font-family: Arial; }
h1, h2 { margin: 3px 0; }
"Живой пример jQuery"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="http://slyweb.ru/css/jqueryiframe.css"
rel="stylesheet" type="text/css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(":header").css({ background:'#CCC', color:'blue' });
});
</script>
</head>
<body class="iframe">
<h1>Header 1</h1>
Contents 1
<h2>Header 2</h2>
Contents 2
</body>
</html>
<style>
body { font-size: 10px; font-family: Arial; }
h1, h2 { margin: 3px 0; }
</style>