InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

HTML tags

  • audio
  • input checkbox
  • label
  • li
  • ol
  • pre
  • template
  • ul
  • video
 
  • Home
  • > Tutorials
  • > HTML
  • > HTML tag

HTML input checkbox

on Sep 25, 2016

HTML input tag with type=checkbox can be used to create check box in html. It can also be nested in label tag. When inside label tag, it can be toggled by clicking anything which is part of label.

Attributes

Some HTML attributes (in addition to global attributes) for input checkbox are

  • checked – The the checkbox is checked initially
  • disabled – The checkbox is disabled
  • value – The value which is sent to server as form data when checked. No value is sent when unchecked.

Example – input checkbox

<form>
<input type="checkbox" name=name1 value="value1" checked><br>
<input type="checkbox" name=name2 value="value2" checked disabled>
</form>
refresh done
try it online

Example – input checkbox with label

<form>
Click wither on "Label1" or checkbox itself.<br>
<label>Label1
  <input type="checkbox" value="value1" checked>
</lable>
</form>
refresh done
try it online

Related

  • jQuery - get checkbox value and checked state
  • CSS :checked - style for selected checkbox and radio

Suggested posts:

  1. CSS selector specificity
  2. Install sass on Mac or Linux using ruby gem
  3. Monitor apache using mod_status on Ubuntu
  4. CSS :enabled :disabled – style of enable and disabled elements
  5. CSS placeholder style
  6. CSS flexbox – display flex and inline-flex
  7. jQuery encode string to html entities
  8. jQuery ui slider and input text box – one way binding
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged HTML tag, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress