What are the major differences between the contenteditable
attribute and the user-modify
css rule?
So far I have spotted two:
user-modify: read-write-plaintext-only
we can disable pasting of rich text.user-modify
is only supported in IE10+ while contenteditable
is supported in IE since version 5.5Thanks!
One major difference is that via the CSS style one could according to some W3C draft have the following values:
- read-only: The user can view, select (if applicable) and copy information out of the element, but cannot modify the contents of the element.
- read-write: The user can view, select (if applicable), and edit the contents of the element.
- write-only: The user can select and edit the contents of the element, but is unable to view the actual contents, nor copy them out. The rendering of the "unreadable" content is user agent dependent (perhaps rendered as nothing, a sequence of bullets or some other form of text-greeking.)
this means that potentially one could set an element to be "write-only" which would (dependent to the implementation) be a state similar to the '<input type="password".....>'
element.
In non-standard -webkit
you can as mentioned make a plaintext only thing, not currently possible in Firefox (as mentioned by my comment above)
Test with current 38 Firefox show that indeed the CSS property has no fact whatsoever on the content becoming editable. The only way seems to be via html-tag attribute contentediable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With