parsing the label usage in HTML and how to set the checkbox's default selected state __html

Source: Internet
Author: User
Tags html form
Introduction of This article:HTML <checkbox> Label usage resolution and how to set the default check state of the CheckBox checkbox (compiled by www.169it.com) The CheckBox CheckBox object represents a selection box in an HTML form. Property Properties for CheckBox checkbox object in HTML Description a ...

HTML <checkbox> Label usage resolution and how to Set checkbox checkbox default Check (collected by www.169it.com)


The check box CheckBox object in HTML represents a selection box in an HTML form.


Properties for CheckBox checkbox objects in HTML

Attribute description

AccessKey Sets or returns the shortcut key to access the checkbox.

ALT Sets or returns the alternate text that is displayed when a checkbox is not supported.

Checked sets or returns whether a checkbox should be selected.

Defaultchecked returns the default value for the Checked property.

Disabled sets or returns whether a checkbox should be disabled.

Form returns a reference to the form that contains the checkbox.

ID to set or return the ID of the checkbox.

Name Sets or returns the names of the checkbox.

TabIndex Sets or returns the tab control order for the checkbox.

Type returns the form element types of the checkbox.

value to set or return values of the checkbox's Value property


Standard properties for checkbox checkbox in HTML

Attribute description

ClassName Sets or returns the class attribute of an element.

Dir Sets or returns the orientation of the text.

Lang Sets or returns the language code for the element.

Title Sets or returns the title property of an element.


Methods for CheckBox checkbox objects in HTML

Method description

Blur () removes the focus from the checkbox.

Click () to simulate a mouse click in a checkbox.

Focus () focuses on the checkbox.


check box checkbox in HTML Set default check code

1 < input name = "checkbox" type = "checkbox" value = "checkbox" checked = "Checked"/>

Note: checked= "Checked" indicates the default check state.


check box checkbox in HTML check box use example

1 2 3 4 5 6 7 < form  action = ""   method = ' Get ' > your favorite water Fruit. < br />< br /> < label >< input  name = "Fruit"   type = "checkbox"  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.