Keep checkbox selected by default

Asked

Viewed 11,995 times

7

How can I make my checkbox appear checked for everyone who enters the site once it has been checked? I am creating in the html field of Wix, free version.

The code template I’m using is as follows:

<form name=myform>
  <input type="checkbox" name=mybox value="1">Trocar  a água dos balde<br>
  <input type="checkbox" name=mybox value="2">Verificar balheiro<br>
  <input type="checkbox" name=mybox value="3">Espirrar herbal<br>
</form>

1 answer

7

To leave the checkbox marked as by default, just add the attribute checked to the element.

Example:

    <form name=myform>
      <input type="checkbox" name=mybox value="1" checked>Trocar  a água dos balde<br>
      <input type="checkbox" name=mybox value="2">Verificar balheiro<br>
      <input type="checkbox" name=mybox value="3" checked>Espirrar herbal<br>
    </form>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.