Hi guys,

I'm trying to create a graphic style where every other word of a heading is a different color.

This code below works but now I want to do the same thing and there is more than one h3 on the page. Of course this code concatenates them together, can anybody write me something which applies these colors to each h3 independently.
PHP Code:

var form_heading = $.trim($(".form_heading h3").text()); // get all text inside a heading
var $new_form_heading "<h3>";  // create a new string ready to replace the old heading

var parts form_heading.split(" ");  // break up heading into words
for(0parts.lengthi++){      // do the different colors
    
if(== 0)
    {
    
$new_form_heading += " <span style='color:#0000ff'>" parts[i]  + "</span>";
    }
    else
    {
     
$new_form_heading += " <span style='color:#ff6600'>" parts[i] + "</span>";
    }    
}
$new_form_heading += "</h3>"//close tag
$('h3').replaceWith($new_form_heading); 
thanks

Silversurfer