I have a SVG as Background Image in a div. When I add a class "svg" via JQuery I would like to change the fill color of this SVG.
How can I do that?
Here is my Code so far:
<!-- HTML -->
<div id="sg_lines"></div>
<!-- JS -->
$('.glyphs').on('click', function(e){
$('#sg_lines').addClass('svg');
});
<!-- CSS -->
#sg_lines {
position: absolute;
z-index: 299;
top: 0px;
left: 0px;
width: 1320px;
height: 1080px;
background-image: url('../../images/lines_foreground.png');
}
#sg_lines.svg img {
fill: red;
}
Thanks
kay899