back to Overview

.text()

Returns the concatenated text content of all nodes in the list.
Web module only.

Syntax

list.text()

Parameters

(return value)
the concatenated text content of the nodes

Description

Returns the concatenated text content of all nodes in the list. This is done by going recursively through all elements and their children. The values of text and CDATA nodes will be appended to the resulting string. Without legacy support, Minified will obtain the data using the textContent property of all nodes.

Please note that unlike jQuery's text(), Minified's will not set text content. Use fill() to set text.

Example

Returns the text of the element with the id 'myContainer'.

var content = $('#myContainer').text();

Comments

comments powered by Disqus

back to Overview

Functions