Is it possible to prevent clicking on an SVG element using CSS?
.disabled{
pointer-events: none;
}
After selecting the SVG element with $(".dasvg")
, the console confirms the selection:
[
<svg width="500" height="500" class="dasvg">
<defs>…</defs>
<defs>…</defs>
<path class="link dragline hidden" d="M0,0L0,0"></path>
<g>…</g>
<g>…</g>
</svg>
]
However, attempts to add a disabled
class to the SVG element using $(".dasvg").addClass("disabled")
or
$(".dasvg")[0].addClass("disabled")
do not work. Can SVG elements be disabled via CSS?