title: jQuery append() just after a element,
body: <p>I have this html :</p>
  
  <pre><code>&lt;div id="idtest"&gt;
  &lt;h4&gt;click me test&lt;/h4&gt;
  &lt;/div&gt;  
  &lt;ul id="collapse-PerfilManage" class="collapse"&gt;
       &lt;li&gt;&lt;a class="privateMenuLinkJS "&gt;&lt;i class="fa  fa-lock"&gt;&lt;/i&gt; elm1&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a class="privateMenuLinkJS inativeLinkCODE"&gt;&lt;i class="fa  fa-lock"&gt;&lt;/i&gt; elm2&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a class="privateMenuLinkJS "&gt;&lt;i class="fa  fa-lock"&gt;&lt;/i&gt; elm3&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a class="privateMenuLinkJS "&gt;&lt;i class="fa  fa-lock"&gt;&lt;/i&gt; elm4&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  </code></pre>
  
  <p>I want to append something inside a "li" that has a "a" element with a class "inativeLinkCODE".</p>
  
  <p>To do this I have this jquery code:</p>
  
  <pre><code>$(document).on("click ", "#idtest", function() {
      $("a").each(function() {
          if ($(this).hasClass("inativeLinkCODE")) {             
              $(this).parent().append("&lt;span&gt;New&lt;/span&gt;");
          }
      });    
  });
  </code></pre>
  
  <p>The result of this code is:</p>
  
  <pre><code>&lt;li&gt;&lt;a&gt;elm2&lt;/a&gt;&lt;span&gt;New&lt;/span&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I would like to have like this:</p>
  
  <pre><code>&lt;li&gt;&lt;span&gt;New&lt;/span&gt;&lt;a&gt;elm2&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Just after the tag "li". Any idea how to do that ?
  I´ve tried append() and after() and not worked.</p>
  
  <p>Here you have the fiddle. 
  <a href="http://jsfiddle.net/a7ww6xyL/" rel="nofollow noreferrer">http://jsfiddle.net/a7ww6xyL/</a></p>
  
  <p>These solution do not fit to my situation 
  <a href="https://stackoverflow.com/questions/20630017/jquery-add-element-after-text">jQuery - add element after text</a>
  <a href="https://stackoverflow.com/questions/2244605/jquery-add-element-after-another-element">jQuery: Add element after another element</a></p>