Answer the question
In order to leave comments, you need to log in
How to get to SVG elements via JS?
Good day everyone.
While building the site, I encountered a problem with SVG.
There is an SVG-frame with a similar structure:
<svg id="district">
<path id="black1"> </path>
<path id="black2"></path>
<path id="white1"></path>
<path id="white2"></path>
</svg>
$('#white1').hover(
function()
{
$('#black1').toggleClass('new');
}
);
Answer the question
In order to leave comments, you need to log in
As far as I know jQuery doesn't support svg out of the box.
Here is a manipulation pluginhttps://habrahabr.ru/post/185750/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question