+ 8

How can I Change the color of an SVG element, through JS??

In an Svg element like the one given below, How can we select the fill portion, and change it in case of An Event, such as onclick?? <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 172 172" style=" fill:#ff22ff;"><g fill="#404040" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><path d="..."

17th Apr 2020, 7:46 AM
ASM
ASM - avatar
2 odpowiedzi
17th Apr 2020, 8:43 AM
Gordon
Gordon - avatar