is inserted into contenteditable html element if left empty

前端 未结 5 2062
梦如初夏
梦如初夏 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:43

    I was running with same problem when i make a element content editable i figure out a
    is inserted at the point i make element contenteditable at same time i remove breaks from the element. That perfectly worked for me.

     myselect.attr('contenteditable', 'true'); 
     myselect.find('br').remove();
    

提交回复
热议问题