vendredi 20 novembre 2020

Can one toggle same checkbox with multiple buttons/"for" attributes (in just html/css)

To avoid code duplication I would like to be able to toggle the same modal contact form hidden by a checkbox from multiple buttons/labels, is this possible in pure html/css? For example:

<button for="chk1">BTN 1</button>
...

<button for="chk1">BTN 2</button>
...

<div id="form-div">
  <input id="chk1" type="checkbox">
  ... model form code
</div>

<button for="chk1">BTN 3</button>
...



Aucun commentaire:

Enregistrer un commentaire