Firefox 自动插入一个
<br type="_moz">
在 contentEditable div 中按下回车键。当我通过 document.execCommand 插入任何元素时,它还会自动添加一个
。
此行为在其他浏览器中不存在。
如何防止在 firefox 中发生这种情况。
最佳答案
如果您使用的是 jQuery,您可以尝试添加 onchange="$(this).children('br[type=\"_moz\"]').remove();"
你的股利。它会随时销毁带有 type='_moz'
的 div 的所有子元素。
关于html - 如何在 Firefox 的 contentEditable div 中禁用 <br type ="_moz",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27500179/