F
F
Flagname2020-05-06 19:58:43
JavaScript
Flagname, 2020-05-06 19:58:43

How to change classes on click and return everything back when you repeat?

Need a pure JS solution.
I did the following https://jsfiddle.net/am0qj4y9/
I don't understand why it doesn't work.

TypeError: Cannot read property 'addEventListener' of undefined

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2020-05-06
@Flagname

Try it yourself https://www.w3schools.com/howto/howto_js_toggle_cl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question