<label>
  <input type="checkbox">
  <span class='whenOn'>Включено</span>
  <span class='whenOff'>Выключено</span>
</label>
<br>
<button>Переключить</button
input[type="checkbox"] ~ .whenOn {
  display: none;
}

input[type="checkbox"] ~ .whenOff {
  display: inline-block;
}

input[type="checkbox"]:checked ~ .whenOn {
  display: inline-block;
}

input[type="checkbox"]:checked ~ .whenOff {
  display: none;
}
document.querySelector('button')
  .addEventListener(
    'click',
    (e) => {
      const checkbox = document.querySelector('input');
      checkbox.checked = !checkbox.checked;
    }
  )

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.