给元素设置 contenteditable 属性后,内容会变得可编辑,但是换行啥的会往其中加入html标签。
如果想要其只能输入纯文本的话,可以使用 contenteditable="plaintext-only"
,但是悲剧的是只有 chrome 这种才支持。。。。
详见:http://www.zhangxinxu.com/wordpress/2016/01/contenteditable-plaintext-only/
给元素设置 contenteditable 属性后,内容会变得可编辑,但是换行啥的会往其中加入html标签。
如果想要其只能输入纯文本的话,可以使用 contenteditable="plaintext-only"
,但是悲剧的是只有 chrome 这种才支持。。。。
详见:http://www.zhangxinxu.com/wordpress/2016/01/contenteditable-plaintext-only/