Jquery .text help appending
Hey all i am trying to append to a .text part of this code here:
-
function buildEventText(event, element) {
$("<span class='event-title' />")
.text('4:00pm ').css("color", "red")
.text('blah').css("color", "blue")
.appendTo(element);
}
But i am unable to do so. It just takes the last .text (in this case, the blah text). I need it to have red for the 4:00 text and then blue for everything else.
I just can not seem to get it to work correctly.
Any help would be great!
David