d is a presentation attribute, and hence can be also be modified using CSS. The property takes either path() or none.
The example below shows how you might apply a new path on hover over an element. The new path is the same as the old one, but adds a line across the heart.
html,
body,
svg {
height: 100%;
}
#svg_css_ex1:hover path {
d: path(
"M10,30 A20,20 0,0,1 50,30 A20,20 0,0,1 90,30 Q90,60 50,90 Q10,60 10,30 z M5,5 L90,90"
);
}
<svg id="svg_css_ex1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<path
fill="none"
stroke="red"
d="M 10,30
A 20,20 0,0,1 50,30
A 20,20 0,0,1 90,30
Q 90,60 50,90
Q 10,60 10,30 z
" />
</svg>
For a <path> animation example, see the CSS d property reference page example.