isContentEditable
Property of dom/HTMLElementdom/HTMLElement
Syntax
var result = element.isContentEditable;
element.isContentEditable = value;
Examples
The following example shows how to use the isContentEditable property to determine whether the user can edit the content of an object.
<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>
Syntax
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]