<label id="zone1"> Доменное имя в зоне .ru<input type="checkbox" /><i></i></label> <label id="zone2">Доменное имя в зоне .com<input type="checkbox" /><i></i></label> 

The point is this, if you click on the checkbox with id zone1, then the class active appears, and if you click on the second checkbox then the class is added to the second but deleted from 1 checkbox

  • one
    Are you on pure js or can jquery ? - Klimenkomud
  • @Klimenkomud Maybe he also wipe the snot? - Igor
  • no matter how you please - Emil Rotatew
  • @EmilRotatew read, izuchayte: add class to remove the class - Dan the Hat
  • @Igor Everyone once started and didn’t know what to do and how :) Another question is that I personally was never too lazy to dig into the question, and if needed, to learn the necessary technology. And the essence is quite simple: remove the class from one element to add another at the event. Google answers this question perfectly - Klimenkomud

1 answer 1

Option on jQuery:

 if( $("#zone1" ).hasClass("active") ) // если есть класс active у #zone1 { $("#zone2" ).removeClass("active"); // удаляем класс active у #zone2 }