M
M
MisTFoR2021-07-06 20:55:16
JavaScript
MisTFoR, 2021-07-06 20:55:16

How to do it so that when you click the button again, val="of" would change to val="on"?

Hello.
I have a button

<button class="button" val="off" filter="БлаБла">
    <span>БлаБла</span>
</button>


When you click on it, it val="off"changes to val="on"
When you press it again, the repeated action does not occur, that is, I need it to change to the third time instead val="on"of changing to val="off"
Tell me how to do it)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2021-07-06
@MisTFoR

E
Evgeny Golubev, 2021-07-07
@bestowhope

toggle js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question