The following example sets the color of the H3s inside 'topics' to red. Only tested in Firefox.
PHP Code:
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = function() {
var topics = document.getElementById('topics');
var headings = topics.getElementsByTagName('h3');
var len = headings.length;
for (var i=0; i<len; i++) {
var heading = headings[i];
heading.style.color = 'red';
}
}
</script>
</head>
<body>
<ul id="topics">
<h3>Blah</h3>
<li>junk</li>
<li>junk</li>
<h3>MoreBlah</h3>
<li>morejunk</li>
</ul>
<h3>not included</h3>
</body>
</html>
Bookmarks