Edit in JSFiddle

$("div").css("background-color:green;").html("Hello World").addClass("new");

              
<div>
  foobar
</div>