La propiedad contentEditable
de la interfaz HTMLElement
especifica si el elemento es editable o no. Este atributo puede tener los siguientes valores:
'true'
indica si el elemento escontenteditable
.'false'
indica que el elemento no puede ser editado.'inherit'
indica que el elemento hereda el estado editable del padre.
Se puede usar la propiedad HTMLElement.isContentEditable
para comprobar el valor Boolean
de esta propiedad.
Sintáxis
editable = element.contentEditable element.contentEditable = 'true'
Especificaciones
Especificación | Status | Comment |
---|---|---|
HTML Living Standard La definición de 'contenteditable' en esta especificación. |
Living Standard | Initial definition |
Browser compatibility
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
In Internet Explorer, contenteditable
cannot be applied to the <table>
, <col>
, <colgroup>
, <tbody>
, <td>
, <tfoot>
, <th>
, <thead>
, and <tr>
elements directly. A content editable <span>
or <div>
element can be placed inside the individual table cells.
See also
- Making content editable
HTMLElement.isContentEditable
- The
contenteditable
global attribute.