JavaScript code
$(function(){ $('#div').append(' <span class="span">2nd span</span>'); $('#div span.span').css('color', 'red'); });