HTML Form How to - Make checkbox checked








Question

We would like to know how to make checkbox checked.

Answer


<!DOCTYPE html>
<html>
<head>
</head><!--  www . ja v  a 2s  .  com-->
<body>
  <input type="checkbox" checked />
  <input type="checkbox" checked="true" />
  <input type="checkbox" checked="false" />
</body>
</html>

The code above is rendered as follows: