jQuery - Changing Element Content
In our several previous jQuery examples we were focused to accessing DOM elements and getting their content. In this article we're going to show you how actually to change a element's content.
Below is a part of a HTML page that contains div with id = "testdiv" and a couple of other elements placed inside it:
<div id="testdiv">
jQuery example
</div>
For changing content we can use a couple of jQuery functions:
.text(TEXT) - for setting plain text