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>
Updated on: 2020-06-24T14:16:39+05:30

194 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements