Function: setTextContent

Sets the text content of the specified node.

Parameters:

node - DOM node to set the text content for.
text - String that represents the text content.
323116
function(node, text)
	{
		if (node.innerText !== undefined)
		{
			node.innerText = text;
		}
		else
		{
			node[(node.textContent === undefined) ? 'text' : 'textContent'] = text;
		}
	}
503277
public void setContent(PaperContent content)
	{
		if (myContent != content)
		{
			if (null != myContent)
			{
				myContent.unattach();
			}
			myContent = content;
		}
		if (null != myContent)
		{
			myContent.attachTo(this);
		}
	}
384801
function text(el, str) {
  if (el.textContent) {
    el.textContent = str;
  } else {
    el.innerText = str;
  }
}
44540
function setNumber(node, number) {
    setText(node, typeof number === 'number' && !isNaN(number) ? number.toString() : undefined);
}
201169
function setContent(content) {

            if (content.nodeType !== undefined) {
                that._content.innerHTML = '';
                that._content.appendChild(content);
            } else {
                that._content.innerHTML = content;
            }


            that._options.cache = true;

            /**
             * Event emitted when the content change.
             * @event ch.Content#contentchange
             * @private
             */
            that.emit('_contentchange');

            /**
             * Event emitted if the content is loaded successfully.
             * @event ch.Content#contentdone
             * @example
             * // Subscribe to "contentdone" event.
             * component.on('contentdone', function (event) {
             *     // Some code here!
             * });
             */
            that.emit('contentdone');
        }
1053277
public void setContentLength(int len) {
        if (mContentLength != len) {
            setHeader(CONTENT_LENGTH, Integer.toString(len));
            mContentLength = len;
        }
    }
487452
function text(node, parent) {
  return this.encode(this.escape(node.value, node, parent), node)
}
225957
@Override
    public void setText(String text) {
        if (text == null) {
            if (headerElem != null) {
                removeChild(headerElem);
                headerElem = null;
            }
            return;
        }

        if (headerElem == null) {
            headerElem = Document.get().createHElement(3);
            attachChild(headerElem);
        }
        headerElem.setInnerText(text);
    }
1367675
function nodeText (node) {
  return squashWhitespace(node.textContent)

  function squashWhitespace (string) {
    return string.replace(/\s{2,}/g, ' ').trim()
  }
}
1109416
function text(node) {
  var data = node.data || {}

  if (
    own.call(data, 'hName') ||
    own.call(data, 'hProperties') ||
    own.call(data, 'hChildren')
  ) {
    return false
  }

  return 'value' in node
}
861385
function Text(doc, content) {
    if (!doc) {
        throw new Error('document argument required');
    }

    if (!(doc instanceof bindings.Document)) {
        throw new Error('document argument must be an instance of Document');
    }

    if (!content) {
        throw new Error('content argument required');
    }

    return new bindings.Text(doc, content);
}
181752
function setTextareaContent(dom) {
  dom.find('textarea').each(function() {
    let elem = percyJQuery(this);
    elem.text(elem.val());
  });

  return dom;
}
1276937
public void setText(Document doc, String text)
    {
        StringReader reader = new StringReader(text);
        HTMLEditorKit kit = (HTMLEditorKit) m_editorPane.getEditorKitForContentType(HTML_CONTENT);
        try {
            int iLength = doc.getLength();
            if (iLength > 0)
                doc.remove(0, iLength);
            kit.read(reader, doc, 0);
        } catch (IOException ex) {
            ex.printStackTrace();
        } catch (BadLocationException ex) {
            ex.printStackTrace();
        }    	
    }
1043422
function(text) {
      if(text == null) return this.node.textContent + (this.dom.newLined ? '\n' : '')

      typeof text === 'function' ? text.call(this, this) : this.plain(text)

      return this
    }
1124927
function(content) {
        if (content) {
            if (content._node) { // map to DOMNode
                content = content._node;
            } else if (content._nodes) { // convert DOMNodeList to documentFragment
                content = Y_DOM._nl2frag(content._nodes);
            }

        }

        Y_DOM.addHTML(this._node, content, 'replace');
        return this;
    }
930266
public void setContent(IContent content)
	{
		this.content = content;
		content.setParent(this);
		content.setPosition(Position.middleCenter(content));
		contentSize = content.size().plus(Size.of(6, 6));
	}
1343819
function text(el, contents) {
  if (el.textContent) {
    el.textContent = contents;
  } else {
    el.innerText = contents;
  }
}