You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozUserInput
MozUserInput style property
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.
Use the readOnly property instead.
Syntax:
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:
Default. Use the element's default behavior for user-input behavior. | |||||||
Element is disabled and will not respond to user input. | |||||||
Element can respond to user input. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
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?
|
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?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, bdo, big, blink, blockquote, body, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, ins, isindex, kbd, label, legend, li, marquee, menu, ol, optgroup, option, p, pre, s, samp, small, span, strike, strong, sub, sup, table, td, textarea, th, tr, tt, u, ul, var
Related pages:
External links:
User Contributed Comments