[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_DOM' (#lazutils)

TDOMNode_WithChildren.SetTextContent

Sets the value for the TextContent property.

Declaration

Source position: laz2_dom.pas line 325

protected procedure TDOMNode_WithChildren.SetTextContent(

  const AValue: DOMString

); override;

Arguments

AValue

  

New value for the TextContent property.

Description

SetTextContent is a overridden method used to set the TextContent property to the value specified in AValue. TextContent is the textual representation of the content for the node as a single TDOMText child node.

SetTextContent calls the Changing method to ensure that the node does not have the value nfReadonly in its Flags property. An EDOMError exception is raised with the NO_MODIFICATION_ALLOWED_ERR constant if the node is marked as read-only.

SetTextContent removes existing ChildNodes by calling DetachChild until FirstChild is no longer assigned.

If AValue is not an empty string (''), the OwnerDocument is used to create a TDOMText node with the specified value. The new text node is added to ChildNodes using the AppendChild method.

See also

TDOMNode.TextContent

  

Textual representation for the DOM Node.

TDOMNode.ChildNodes

  

Provides access to the list of Child nodes for the current node.

TDOMNode.FirstChild

  

Gets the first child node for the current node.

TDOMNode.DetachChild

  

Detaches the specified child node from the DOM sub-tree for the node.

TDOMNode.Changing

  

Determines if the Node and its owner document can be modified.

EDOMError

  

Base class for exceptions raised in DOM interface classes.


Version 3.2 Generated 2024-02-25 Home