Force IE contentEditable element to create line breaks on Enter key, without breaking Undo

前端 未结 7 1835
时光取名叫无心
时光取名叫无心 2020-12-05 06:59

On Internet Explorer, a contentEditable DIV creates a new paragraph (

) each time you press Enter whereas Firefox creates a
<
7条回答
  •  爱一瞬间的悲伤
    2020-12-05 07:49

    Hold down shift when you press enter for breaks, don't hold it down for full paragraphs. This behaviour is the same by default in Firefox, given a contenteditable area containing a paragraph: i.e.

    If you are typing here

提交回复
热议问题