title: Inserting text to summernote from javascript function
body: <p>So I've been trying to insert text into the summernote within a normal javascript function. I have a list of values that when clicked should append themselves into the actual text area. The functions are firing because I have messages being logged to the console when I click but for some reason nothing is still appending. Here is the function:</p>
  
  <pre><code>function appendListItem(ele){
      console.log("Clicked!");
      var id = $(ele).attr("id");
      console.log(typeof(id));
      console.log("ID:" + id);
      //var htmlStr = "&lt;p&gt;#"+id+"&lt;/p&gt;";
      $(".summernote").summernote('code', id);
      console.log($("#summernote").summernote('code'));
  }
  </code></pre>
  
  <p>Everything is working except for the 7th line, $(".summernote").summernote('code', id);. I've tried using 'insertText' as well in the summernote function. The id is a string. And I've tried passing in an html string as evidenced by the commented out line (Line 6). Any help you can give me would be greatly appreciated!</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>Here is my html as requested:</p>
  
  <pre><code>&lt;body&gt;
      &lt;div&gt;&lt;img src="./images/Logo.png" alt="Logo"  class="logo-center"&gt;&lt;/div&gt;
      &lt;div id="summernote"&gt;&lt;/div&gt;
      &lt;div class="checkList"&gt;
          &lt;p id="checkTitle"&gt;CHECKLIST (&lt;span id="fraction"&gt;0/5&lt;/span&gt;)&lt;/p&gt;
          &lt;ul class="list-group" id="trigList"&gt;
              &lt;li class='list-group-item'&gt;&lt;a id='mood' onclick='appendListItem(this)'&gt;Mood&lt;/a&gt;&lt;/li&gt;
              &lt;li class='list-group-item'&gt;&lt;a id='phone' onclick='appendListItem(this)'&gt;Phone&lt;/a&gt;&lt;/li&gt;
              &lt;li class='list-group-item'&gt;&lt;a id='email' onclick='appendListItem(this)'&gt;Email&lt;/a&gt;&lt;/li&gt;
              &lt;li class='list-group-item'&gt;&lt;a id='lead' onclick='appendListItem(this)'&gt;Lead&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div&gt;&lt;button type="button" class="btn btn-primary" onclick="logNote();"&gt;Log Note&lt;/button&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>