Baseline Widely available
The type
read-only property of the SVGTransform
interface represents the type
of transformation applied, specified by one of the SVG_TRANSFORM_*
constants defined on this interface.
An integer
; the type of value as an unsigned short.
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<rect id="rect" x="50" y="50" width="100" height="100" fill="blue" />
</svg>
const rect = document.getElementById("rect");
const transformList = rect.transform.baseVal;
// Create and add a translation transform
const translateTransform = rect.ownerSVGElement.createSVGTransform();
translateTransform.setTranslate(20, 30);
transformList.appendItem(translateTransform);
// Check the type of the added transform
console.log(transformList.getItem(0).type); // Output: 2 (SVG_TRANSFORM_TRANSLATE)
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4