pQuery\DomNode::setInnerText PHP Method

setInnerText() public method

Similar to JavaScript innerText, will replace child nodes with new text
public setInnerText ( string $text, HtmlParserBase $parser = null ) : boolean | array
$text string
$parser HtmlParserBase Null to auto create instance
return boolean | array True on succeed, array with errors on failure
    function setInnerText($text, $parser = null)
    {
        $this->clear();
        if (trim($text)) {
            if ($parser === null) {
                $parser = new $this->parserClass();
            }
            $parser->root =& $this;
            $parser->setDoc($text);
            $parser->parse_all();
        }
        return $parser && $parser->errors ? $parser->errors : true;
    }
DomNode