You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
L'atribut global contenteditable és un atribut enumerat que indica si l'element ha de ser modificable per l'usuari. Si és així, el navegador modifica el seu widget per permetre l'edició. L'atribut ha de prendre un dels següents valors:
- true o cadena buida, indica que l'element ha de ser editable;
- false, indica que l'element no ha de ser editable
Si aquest atribut no està definit, el seu valor per defecte és heretat del seu element pare.
Aquest és un atribut enumerat i no un booleà. Això vol dir que l'ús explícit d'un dels valors true, false o empty string és obligatori i que no està permès una forma abreujada com <label contenteditable>
Exemple d'etiqueta </label>
. L'ús correcte és <label contenteditable="true">
Exemple d'etiqueta </label>
.
Especificacions
Especificació | Estat | Comentari |
---|---|---|
HTML Living Standard The definition of 'contenteditable' in that specification. |
Living Standard | Sense canvis des de l'última instantània, HTML 5.1 |
HTML 5.1 The definition of 'contenteditable' in that specification. |
Recommendation | Instantània de HTML Living Standard, sense canvis des de HTML5 |
HTML5 The definition of 'contenteditable' in that specification. |
Recommendation | Instantània de HTML Living Standard, definició inicial. |
Navegadors compatibles
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Suport bàsic | (Yes) | 3.0 (1.9) | (Yes) | (Yes) | (Yes) |
Característica | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Suport bàsic | (Yes) | 1.0 (1.9) | (Yes) | (Yes) | (Yes) | (Yes) |