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

前端 未结 7 1745
时光取名叫无心
时光取名叫无心 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

    Consider using <span contenteditable="true"></span> when using Internet Explorer. You may not want to do this with Chrome because the focus looks funny. You will probably want to implement your own onfocus and onblur code.

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