Latest web development tutorials

HTML DOM Checkbox type property

Checkbox Object Reference Checkbox objects

Definition and Usage

type property returns the type of form element.

For a checkbox object, the property always returns "checkbox".

grammar

checkboxObject.type


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute type


Examples

Examples

The following example returns a checkbox form element type:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
var x = document.getElementById ( "check1") type.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Form>
<Input type = "checkbox" id = "check1"> do you like summer?
</ Form>
<Button type = "button" onclick = "displayResult ()"> Display input type </ button>

</ Body>
</ Html>

try it"


Checkbox Object Reference Checkbox objects