In my program I want to do both things with jquery/javascript:
@synthet1c has described the problem. My solution is:
$("head").append(''); var element = $("head").children(':last'); element.html('.redclass{color: darkred;}');