User Tools

Site Tools


Sidebar

token:token_gettext

token_getText()

Function to get the contents of an HTML or XML token, similar to .innerHTML in JavaScript. The function can return text only or include all nested tags. This function is the equivalent of the method .getText()

Usage

if(token.isTag("p")) {
   var paragraphText = token_getText(token, false);
   var paragraphHTML = token_getText(token, true);
}

Parameters

Parameter Data type Required Description
token Token object true The token to get the contents of
includeHTML boolean Sets whether you want to get only the stripped text without HTML (false, default) or the full content (true)

Return Values

Value String Value
string The token content
token/token_gettext.txt · Last modified: 2017/06/03 14:09 (external edit)