December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("$mySpan").html("content"); . . . $("$mySpan").html("newer content"); . . . $("$mySpan").html("even newer content");
Rather than prepending or appending text (or content, for that matter) to an element, you may want to replace the element content entirely. The simplest way to do this in jQuery is to use .html(), which sets the value of the content to whatever string or object you pass into it, thus replacing the existing content.
Read now
Unlock full access