You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozUserInput

MozUserInput style property

Browser support:
Specifies or retrieves whether the element can have the input focus.
Typically used for input elements to enable or disable them. This property is the same as the user-input property in the CSS3 declaration.
Use the readOnly property instead.

Syntax:

object.MozUserInput;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -moz-user-input

Possible values:

The type of this property is string.
 One of the following values: 
auto
Default. Use the element's default behavior for user-input behavior.
disabled
Element is disabled and will not respond to user input.
enabled
Element can respond to user input.
inherit
Takes the value of this property from the computed style of the parent element.
none
The element is considered to be neither enabled nor disabled.
Default: auto.

Example HTML code 1:

This example illustrates the use of the -moz-user-input property:
<head>
    <style>
        .example {
            -moz-user-input: disabled;
        }
    </style>
</head>
<body>
    <textarea class="example">The user is not able to change this text.</textarea>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the MozUserInput property in JavaScript:
<head>
    <script type="text/javascript">
        function ChangeUserInput (selectTag) {
            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the text of the selected option
            var modifyState = selectTag.options[whichSelected].text;

            var textArea = document.getElementById ("myArea");

            if ('MozUserInput' in textArea.style) {
                textArea.style.MozUserInput = modifyState;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <textarea id="myArea">Change user input ability</textarea>

    <select onchange="ChangeUserInput (this);" size="5">
        <option selected="selected" />auto
        <option />enabled
        <option />disabled
        <option />inherit
        <option />none
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content