html5 - What are the consequences of using contentEditable on a textarea? -
as can see, @ least on chrome, contenteditable
attribute seems ignored on textarea
.
question a: how it's supposed work?
question c: using contenteditable
on textarea
have consequences other proving you're idiot?
question d: why there no question b? just kidding, had clown breakfast today. :d
textarea { /* not relevant question, demo */ display: block; width: 500px; }
<textarea contenteditable="true">contenteditable="true"</textarea> <textarea contenteditable="false">contenteditable="false"</textarea> <textarea contenteditable="true" readonly>contenteditable="true" readonly</textarea> <textarea contenteditable="true" disabled>contenteditable="true" disabled</textarea>
contenteditable
has no effect , on textarea, the html5 spec mute subject.
contenteditable=false
allows make element not editable inside element contenteditable=true
. default behavior inherit
value of contenteditable
every children of editable element editable.
you can still delete non-editable element not edit it. demonstrated in following snippet.
textarea { /* not relevant question, demo */ display: block; width: 500px; }
<div contenteditable="true"> <span>editable span</span> <span contenteditable="false">this 1 not</span> </textarea>
Comments
Post a Comment