title: Append anchor tag inside list-item
body: <p>I have an unordered list:</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;ul id="blogs"&gt;
     &lt;li&gt;
       &lt;a class="vimg" href="/blogs/news/6875583-hurricane-sandy"&gt;
        &lt;img src="mydomainvideo_icons.jpg?1542"&gt;
      &lt;/a&gt;
   &lt;/li&gt;
      &lt;a href="/blogs/news/6875583-hurricane-sandy"&gt;
        &lt;strong class="titlen"&gt;Hurricane Sandy&lt;/strong&gt;
        &lt;p class="newsp"&gt;lorem ispum lorem ispumu...&lt;/p&gt;
      &lt;/a&gt;
      &lt;a class="readp" href="/blogs/news/hurricane-sandy"&gt;Read More&lt;/a&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I would like to alter the html above with jQuery, so the output would be the following:</p>
  
  <pre><code>  &lt;ul id="blogs"&gt;
     &lt;li&gt;
        &lt;a class="vimg" href="/blogs/news/6875583-hurricane-sandy"&gt;
         &lt;img src="mydomainvideo_icons.jpg?1542"&gt;
       &lt;/a&gt;
       &lt;a href="/blogs/news/6875583-hurricane-sandy"&gt;
         &lt;strong class="titlen"&gt;Hurricane Sandy&lt;/strong&gt;
         &lt;p class="newsp"&gt;lorem ispum lorem ispumu...&lt;/p&gt;
      &lt;/a&gt;
      &lt;a class="readp" href="/blogs/news/hurricane-sandy"&gt;Read More&lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is the jquery I have but its a not working:</p>
  
  <p>jQuery:</p>
  
  <pre><code>  $("#blogs li").each(function(){
  
         if ($(".video-container").length &gt; 0  &amp;&amp; $(this).children('img').length == 0){
            var vidindex = $('.readp').attr('href')
            $(this).find('.video-container').remove();
            $(this).append('&lt;a class="vimg" href=""&gt;&lt;img src="{{ 'video_icons.jpg' | asset_url }}"/&gt;&lt;/a&gt;');
            $('.titlen').appendTo('.vimg')
            $(this).find('a').attr("href", vidindex)
       }
        $(this).find('img').replaceWith(function(){ return '&lt;img src="'+this.src+'"/&gt;';});
  });
  </code></pre>