How to change SVG fill color with jQuery on hover?

How to change SVG fill color with jQuery on hover?

Hello good people,


I need help with changing SVG fill color on hover with jQuery. Thing is that in one SVG i can have path, circle or polygon elements and wish to change color on fill attribute  on them when that particular SVG is hovered. Color should reverse back when pointer is not hovering element. I think that adding CSS class to do that is not right way because its simple color change on hover and can be done with jQuery attr() function(i found that on web). Also i found here on forum that jQuery functions mousenter() and mouseleave() should be used for hover. But i didn't menaged to write my code. :(

To represent real world example:

<a><svg>
   <path></path>
   <circle></circle>
   <polygon></polygon>
</svg></a>

So can someone help me, how should my jQuery code look like to achive when you hover A that fill color of path, circle, polygon changes and reverse back when you unhover. Keep in mind that i have more of SVGs on page so this should change color only on path, circle,polygon that are under hovered A element. I found on web this has to do something with $(this) jQuery but still i could not manage to write good code. :(

Thank you in advance,
Vladimir