看好多网站用contenteditable=“true”来模拟textarea这样做和原生的textarea相比有什么优势吗?什么情况下用contenteditable来模拟更适合?
解决方案
如果你需要样式,比如粗体或者下划线,或者需要插入图片,这时就需要用 contenteditable 。
看好多网站用contenteditable=“true”来模拟textarea这样做和原生的textarea相比有什么优势吗?什么情况下用contenteditable来模拟更适合?
如果你需要样式,比如粗体或者下划线,或者需要插入图片,这时就需要用 contenteditable 。