SVGAnimatedString: baseVal property - Web APIs | MDN

Value

Getting the property returns a string that represents the non-animated value of the reflected attribute, if it has been set. If the reflected attribute is not specified but has an alternative deprecated version that has been set, then its value will be returned instead. If neither reflected attribute is set, then the property will return an initial value for the reflected attribute if one exists, and otherwise the empty string ("").

The property must be set to a TrustedScriptURL if the reflected attribute's element is an SVGScriptElement and Trusted Types are enforced by a CSP. For all other cases, the value can be a string (or an object that can be resolved to a string). The property sets the value of the reflected attribute if it is defined, but will set the alternative deprecated version of the reflected attribute if it is defined and the reflected attribute is not.

Note that TrustedScriptURL or any other trusted type can be set for baseVal on any element, because the trusted types resolve to strings. However TrustedScriptURL must be used for SVGScriptElement.href.baseVal when trusted types are enforced.

Exceptions

TypeError

Thrown if the reflected attribute's element is SVGScriptElement, and the property is set to a string when Trusted Types are enforced by a CSP, and no default policy is defined.

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# __svg__SVGAnimatedString__baseVal

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.