Baseline Widely available
The operator
read-only property of the SVGFEMorphologyElement
interface reflects the operator
attribute of the given <feMorphology>
element. It takes one of the SVG_MORPHOLOGY_OPERATOR_*
constants defined on this interface.
An SVGAnimatedEnumeration
object.
operator
Property
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter with the "dilate" operator -->
<feMorphology in="SourceGraphic" operator="dilate" radius="3" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
fill="lightblue"
filter="url(#morphologyFilter)" />
</svg>
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");
// Access the 'operator' property
const operatorEnum = morphologyNode.operator.baseVal;
console.log(operatorEnum); // Output: 2 (SVG_MORPHOLOGY_OPERATOR_DILATE)
Specifications Browser compatibility See also
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