You are here: Reference > CSS > properties > browser specific extensions > -moz-user-focus

-moz-user-focus property

Browser support:
Specifies whether the element can have focus.
This property is the same as the user-focus property in the CSS3 declaration.
JavaScript page for this property: MozUserFocus. You can find other example(s) there.

Possible values:

 One of the following values: 
auto
Default. Use the default focus behavior for the element.
ignore
Seems to be like 'none'.
inherit
Takes the value of this property from the computed style of the parent element.
none
The element can not receive focus.
normal
Seems to be like 'auto'.
Default: auto.

Example HTML code 1:

This example illustrates the use of the -moz-user-focus property:
<head>
    <style>
        .example {
            -moz-user-focus: none;
            /* it doesn't seem to working so we need some workaround */
            -moz-user-select: none;
            -moz-user-input: disabled;
        }
    </style>
</head>
<body>
    <input type="text" onfocus="alert ('Focus on 1. object')" value="Press tab to focus" />
    <input type="text" onfocus="alert ('Focus on 2. object')" class="example" value="This element cannot receive focus" />
    <input type="text" onfocus="alert ('Focus on 3. object')" value="Press tab to focus" />
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content