R
R
rinatoptimus2016-09-30 12:32:35
JavaScript
rinatoptimus, 2016-09-30 12:32:35

How to change SVG color on button click?

When you click on the button, the color changes, but it is necessary that when you click it again, the color changes back to the original one. For example, they pressed the button - the white figure became blue, they pressed the button again - it became white again. Tried toggle, doesn't work. Does it work with SVG? Example here

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-09-30
@rinatoptimus

C svg only rolls if you didn't set a color in the svg itself, and you did.
The color set in svg cannot be overridden via CSS. Unless you are changing the attribute value with js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question