title: Element edited in contenteditable mode with added line on click doesnt work on second line
body: <p>If you edit this element add lines and click on first line it works, but if you click on second or third line it goes wrong. There is code I used.</p>
  
  <p>JS:</p>
  
  <pre><code>$('.layer-text').append("&lt;p class='textbox' contenteditable='true'&gt;Click me&lt;/p&gt;")
  
  $("body").on('click', '.layer-text', function(e){
  
          if(!$(e.target).is('.textbox')) {
  
              $(".textbox").removeClass("active");
              alert("!textbox");
  
          }
  });
  
  $('.layer-text').on('click', '.textbox', function() {
          $(this).addClass("active");
          alert("is textbox");
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class='layer-text'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>body, .layer-text {width: 300px; height: 400px; background: #f0f0f0;}
  .textbox.active {background: red;}
  </code></pre>
  
  <p>Thank you for help. Kasta</p>