Toggle Implementation Question

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

const handleClick = e => {
  let isOn = e.currentTaget.classList.contains('on');
  if (isOn) {
    e.currentTaget.classList.remove('on');
  } } else {
    e.currentTaget.classList.add('on');
  }
}

Hello!

I want to turn on the other elements when the on button turns off How do I insert the code?

I'd really appreciate your help!

javascript react

2022-09-20 11:17

1 Answers

This is what we usually do:

event target = clicked yosok


2022-09-20 11:17

If you have any answers or tips


© 2022 pinfo. All rights reserved.