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

TDOMElement.SetAttribute

Sets the value in the AttribStrings property.

Declaration

Source position: laz2_dom.pas line 637

public procedure TDOMElement.SetAttribute(

  const name: DOMString;

  const value: DOMString

);

Arguments

name

  

Name of the DOM Attribute updated in the method.

value

  

New value for the attribute in the AttribStrings property.

Description

SetAttribute is a method used to set the value for an attribute in the indexed AttribStrings property. It calls Changing to ensure that the DOM Element is not marked as read-only. An EDOMError exception is raised if the element cannot be modified.

SetAttribute locates the TDOMAttr in the Attributes property with the name specified in the name argument. If it is not found, a new TDomAttr instance is created with the required name and added to Attributes. SetAttribute stores the value argument as the NodeValue for the attribute instance.

See also

TDOMElement.AttribStrings

  

Provides indexed access to Attributes and their value as a String.


Version 3.2 Generated 2024-02-25 Home