How to get only html code without <!--StartFragment--> on paste in contenteditable div..?
问题 I used contenteditable div to paste and replace all html tags with <br> tag. But the pasted html start with <html><body><!--StartFragment--> and end with <!--EndFragment--></body></html> . When i try to replace pasted html with <br> tag, it inserts three <br> tags at start position. So the pasted content start and end with three line breaks unnecessarily . How to remove those unwanted tags on paste..? Javascript code used to get pasted html content: $(document).on('paste','#div-id',function(e