简体   繁体   English

富文本编辑 - designMode vs contentEditable

[英]Rich Text Editing - designMode vs contentEditable

When creating a cross-browser rich text editor. 创建跨浏览器的富文本编辑器时。 Which would you use and why? 你会用哪个?为什么?

Keep in mind that pasting has to be resilient to stand against multiple sources (notepad, word, other websites) and it should not be dependent on any Javascript libraries. 请记住,粘贴必须能够抵御多个来源(记事本,文字,其他网站),并且它不应该依赖于任何Javascript库。

You probably want contentEditable. 您可能想要contentEditable。 designMode applies to the document, contentEditable to a specific element and its children. designMode适用于文档,contentEditable适用于特定元素及其子元素。

http://blog.whatwg.org/the-road-to-html-5-contenteditable http://blog.whatwg.org/the-road-to-html-5-contenteditable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM