isContentEditable property
Gets the value that indicates whether the user can edit the contents of the object.
Syntax
HRESULT value = object.get_isContentEditable(* p);
Property values
Type: VARIANT_BOOL
Examples
The following example shows how to use the IHTMLElement3::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 type="text/javascript"> 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>
Show: