?
This document uses PHP Chinese website manual Release
全局屬性contenteditable 是一個枚舉屬性(enumerated attribute),表示元素是否可被用戶編輯。 如果可以,瀏覽器會修改元素的部件(widget)以允許編輯。該屬性必須是下面的值之一:
true
或空字符串,表示元素是可編輯的;
false
表示元素不是可編輯的。
如果沒有設(shè)置該屬性,其默認(rèn)值繼承自父元素。
該屬性是一個枚舉屬性(enumerated one),而非布爾屬性(Boolean one)。這意味著必須顯式設(shè)置其值為true
、false
或空字符串中的一個,并且不允許簡寫為 <label contenteditable>Example Label</label> (注:這在大部分瀏覽器中是有效的)正確的用法是<label contenteditable="true">Example Label</label>
。
規(guī)范 | 狀態(tài) | 評論 |
---|---|---|
HTML Living Standard該規(guī)范中'contenteditable'的定義。 | 生活水平 | 最新的快照,HTML 5.1沒有變化 |
HTML 5.1該規(guī)范中'contenteditable'的定義。 | 建議 | HTML Living Standard的快照,HTML5沒有改變 |
HTML5該規(guī)范中'contenteditable'的定義。 | 建議 | HTML Living Standard的快照,最初的定義。 |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | 3.0 (1.9) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Yes) | 1.0 (1.9) | (Yes) | (Yes) | (Yes) | (Yes) |