跳到主要内容

text

text() ⇒ string
text(content) ⇒ self
text(function(index, oldText){ ... }) ⇒ self [v1.1.4]

Get or set the text content of elements in the collection. When no content is given, returns the text contents of all the elements in the collection, if no element exists, null will be returned. When content is given, uses it to replace the text contents of each element in the collection. This is similar to html, with the exception it can't be used for getting or setting HTML.