Dealing with line Breaks on contentEditable DIV

后端 未结 7 1696
粉色の甜心
粉色の甜心 2020-11-27 12:41

I have a problem with contenteditable line breaks on SAFARI/CHROME. When I press \"return\" on a contentEditable

, instead of creating a
相关标签:
7条回答
  • 2020-11-27 13:22

    You might want to check out the css white-space property. Setting the style to white-space: pre-wrap allows you to get rid of all that javascript, because it changes the behavior of whitespace to display instead of collapse.

    And see this answer: HTML - Newline char in DIV content editable?

    0 讨论(0)
提交回复
热议问题