You are here: Reference > JavaScript > client-side > HTML DOM > properties > status (input, textarea)

status property (input, textarea)

Browser support:
Returns a Boolean value that indicates whether the current element is selected.
The status property is equivalent to the checked property for input:checkbox and input:radio elements and has no effect for textarea elements. Therefore, use the cross-browser checked property instead.

Syntax:

object.status;
You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

Boolean or null that specifies or retrieves the status of the element.
One of the following values:
false
The element is not selected.
null
The status property has no meaning for the current elemet.
true
The element is selected.
Default: false.

Example HTML code 1:

This example illustrates the use of the status property:
<head>
    <script type="text/javascript">
        function GetCheckedState () {
            var input = document.getElementById ("myInput");
            var isChecked = input.status ? input.status : input.checked;
            isChecked = (isChecked)? "checked" : "not checked";
            alert ("The checkBox is " + isChecked);
        }
    </script>
</head>
<body>
    Check it!
    <input type="checkBox" id="myInput" onclick="GetCheckedState ();"/>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content