You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozUserModify
MozUserModify style property | webkitUserModify style property
MozUserModify | ||||||
webkitUserModify |
Specifies or retrieves which part of the contents of an element can be modified by the user.
This property is the same as the user-modify property in the
CSS3 declaration.
The MozUserModify property does not seem to work in Firefox.
In Google Chrome and Safari, use the webkitUserModify property together with the contentEditable property.
Syntax:
You can find the related objects in the Supported by objects section below.
MozUserModify: | This property is read/write. |
webkitUserModify: | This property is read/write. |
CSS page for this property: -moz-user-modify |
Possible values:
The type of this property is string.
One of the following values:
Takes the value of this property from the computed style of the parent element. | |||||||
Default. User can view/select/copy information in the element, but cannot modify the contents. | |||||||
User can view/select/copy and edit the contents of the element. | |||||||
User can select/edit only the plain text content of the element. | |||||||
User can select/edit element contents, but cannot view it. |
Default: read-only.
Example HTML code 1:
This example illustrates the use of the -moz-user-modify and the -webkit-user-modify properties:
|
||||
<head> <style> .readonly { -moz-user-modify: read-only; -webkit-user-modify: read-only; } .readwrite { -moz-user-modify: read-write; -webkit-user-modify: read-write; } </style> </head> <body> <div class="readonly" contenteditable="true">The user is not able to change this text.</div> <div class="readwrite" contenteditable="true">This text can be modified by the user.</div> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the MozUserModify and webkitUserModify properties in JavaScript:
|
||||
<head> <style> .readonly { -moz-user-modify: read-only; -webkit-user-modify: read-only; } </style> <script type="text/javascript"> function ChangeEditable (selectTag) { var div = document.getElementById ("example"); if ('MozUserModify' in div.style) { div.style.MozUserModify = selectTag.value; } else if ('webkitUserModify' in div.style) { div.style.webkitUserModify = selectTag.value; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <div id="example" class="readonly" contenteditable="true">The user is not able to change this text.</div> <select onchange="ChangeEditable (this);" size="3"> <option value="read-only" selected="selected" />read-only <option value="read-write" />read-write </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, q, s, samp, small, span, strike, strong, sub, sup, table, td, textarea, th, tr, tt, u, ul, var, xmp
Related pages:
External links:
Mozilla_Extensions (Mozilla Developer Center)
-webkit-user-modify (Safari Reference Library)
user-modify (W3C)
-webkit-user-modify (Safari Reference Library)
user-modify (W3C)
User Contributed Comments