isContentEditable property
Gets the value that indicates whether the user can edit the contents of the object.
Syntax
| JavaScript | |
|---|
Property values
Type: Boolean
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 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>
See also
- a
- abbr
- acronym
- address
- applet
- area
- article
- aside
- b
- base
- baseFont
- bdo
- bgSound
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- comment
- custom
- dd
- del
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- figcaption
- figure
- font
- footer
- form
- frame
- frameSet
- head
- header
- hgroup
- hn
- hr
- html
- i
- iframe
- img
- input type=button
- input type=checkbox
- input type=email
- input type=file
- input type=hidden
- input type=image
- input type=number
- input type=password
- input type=radio
- input type=range
- input type=reset
- input type=search
- input type=submit
- input type=tel
- input type=text
- input type=url
- ins
- isIndex
- kbd
- label
- legend
- li
- link
- listing
- map
- mark
- marquee
- menu
- nav
- nextID
- noBR
- noFrames
- noScript
- object
- ol
- option
- p
- plainText
- pre
- q
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- title
- tr
- tt
- u
- ul
- var
- wbr
- xml
- xmp
Show: