Computer >> Computer tutorials >  >> Programming >> Javascript

The correct way to work with HTML5 checkbox


The following is the correct way −

<input name = "your_name" value = "your_value" type = "checkbox">

Example

Here is an example −

<!DOCTYPE html>
<html>
   <head>
      <title>Checkbox Control</title>
   </head>
   <body>
      <form>
         <input type = "checkbox" name = "maths" value = "on"> Maths
         <input type = "checkbox" name = "physics" value = "on"> Physics
      </form>
   </body>  
</html>