Firefox automatically inserts a
<br type="_moz">
in contentEditable divs on press of enter key. It also adds a <br> automatically when I insert any element through document.execCommand.
This behavior is not present in other browsers.
How to prevent this from happening in firefox.
If you are using jQuery, you can try add onchange="$(this).children('br[type=\"_moz\"]').remove();"
on your div. It will destroy any childrens of div with type='_moz'
at anytime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With