- If no parameters are specified, this returns an associative array of all
name/value pairs.
- If both $name and $value are set, then this will set the attribute name/value
pair for all items in this object.
- If $name is set, and is an array, then
all attributes in the array will be set for all items in this object.
- If $name is a string and is set, then the attribute value will be returned.
When an attribute value is retrieved, only the attribute value of the FIRST
match is returned.
public attr ( mixed $name = null, string $value = null ) : mixed | ||
$name | mixed | The name of the attribute or an associative array of name/value pairs. |
$value | string | A value (used only when setting an individual property). |
return | mixed | If this was a setter request, return the DOMQuery object. If this was an access request (getter), return the string value. |