is inserted into contenteditable html element if left empty

前端 未结 5 2091
梦如初夏
梦如初夏 2021-01-07 17:57

I have a

and when I enter some content into it, then delete these content, it seems like the b
5条回答
  •  渐次进展
    2021-01-07 18:34

    Another way around this problem is to change the behavior of how the white space is handled inside the element. Use CSS:

    white-space: pre-wrap;
    

    Check out this link for both the solutions.

提交回复
热议问题