Checkbox

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Check Box</title>
</head>
<body>
    <form action="/server">
    <input type="checkbox" name="age" id="age" checked/>
    <label for="age" >I am 18+</label>
    <br/>
    <button>Enter</button>
    <!-- WHENEVER CHECK BOX IS TICKED "ON" IS PASSED INTO THE URL -->
      <!-- USING VALUE ATTRIBUTE -->
      <input type="checkbox" name="subject" id="math" value="math" />
      <label for="math">math</label>
      <input type="checkbox" name="subject" id="eng" value="eng" />
      <label for="eng">english</label>
      <input type="checkbox" id="science" name="subject" value="science" />
      <label for="science">science</label>
      <button>submit</button>









</form>
</body>

</html>

Comments

Popular posts from this blog

TextArea

unordered list with image link

Select input form