title: Prevent contenteditable adding div on Enter in Ionic
body: <p>I have a contenteditable element in <code>home.html</code>,  whenever I type some stuff and hit Enter it creates a new <code>&lt;div&gt;</code>:</p>
  
  <p><code>home.html</code> code</p>
  
  <pre><code>&lt;div class="context_menu"&gt;&lt;p contenteditable="true"&gt;second section&lt;/p&gt;&lt;/div&gt;
  </code></pre>
  
  <p>How can I prevent this from happening or replace with a <code>&lt;br&gt;</code> tag?</p>
  
  <p>There is a solution available in JS, I added the code in `home.ts' in ngOnInit as shown below, I have installed jQuery but it did not work, maybe I have copied it wrongly?</p>
  
  <pre><code>  ngOnInit(){
  
       $('div[contenteditable]').keydown(function(e) {
         // trap the return key being pressed
         if (e.keyCode === 13) {
          // insert 2 br tags (if only one br tag is inserted the cursor won't go to the next line)
           document.execCommand('insertHTML', false, '&lt;br&gt;&lt;br&gt;');
           // prevent the default behaviour of return key pressed
           console.log("pressed");
           return false;
         }
       });
  </code></pre>