How to recreate google keep note

Solution 1
document.execCommand("defaultParagraphSeparator", false, "p");
document.execCommand("defaultParagraphSeparator", false, "br");
Solution 2