AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The text()
sets or returns the text content of selected element(s).
Unlike the .html() method, .text() can be used in both XML and HTML documents.
The result of the .text() method is a raw string containing the combined text of all matched elements.
$("#btnGet").click(function ()
{
$("#demo1").html($("#source").text());
});
$("#btnSet").click(function ()
{
$("#demo1").text("Hello World");
});