1 out of 2 rated this helpful - Rate this topic

isContentEditable property

[This documentation is preliminary and is subject to change.]

Gets the value that indicates whether the user can edit the contents of the object.

Syntax

JavaScript

p = object.isContentEditable

Property values

Type: Boolean

VARIANT_FALSE (false)

The content cannot be edited.

VARIANT_TRUE (true)

The content can be edited.

Examples

The following example shows how to use the isContentEditable property to determine whether the user can edit the content of an object.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/editRegions.htm


<head>
<SCRIPT>
function chgSpan() {
    currentState = oSpan.isContentEditable;
    newState = !currentState;
    oSpan.contentEditable = newState;
    oCurrentValue.innerText = newState;
    newState==false ? oBtn.innerText="Enable Editing" :
        oBtn.innerText="Disable Editing"
}
</SCRIPT>
</head>
<body onload="oCurrentValue.innerText = oSpan.isContentEditable;">
<P>Click the button to enable or disable SPAN content editing.</P>
<P>
<BUTTON ID="oBtn" onclick="chgSpan()">Enable Editing</BUTTON>
</P>
<P><SPAN ID="oSpan">You can edit this text.</SPAN></P>
Span can be edited: <SPAN ID="oCurrentValue"></SPAN>
</body>

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ