Javascript for changeing the color of span elements with a particular class attribute.
<script type="text/javascript">
function changecolor() {
for (i=0;i<document.getElementsByTagName("span").length; i++) {
if (document.getElementsByTagName("span").item(i).className == "myclass"){
document.getElementsByTagName("span").item(i).style.color = "green";
}
}
}
</script>
.......
<a href="#" onclick="changecolor();">Change Color</a>
.......
<span class="myclass">Hi There</span>