Adding anchor tag with insertafter in jquery
<p>I'm a newbie to jquery. I want to know why can't I insert an anchor tag with insertafter, but I can add h2 tag and other tags. Please help me. and here is the link to the code.</p>

<p><a href="http://jsbin.com/iboquj/4/edit" rel="nofollow">http://jsbin.com/iboquj/4/edit</a></p>

<pre><code>    $(function(){

         $('&lt;h2&gt;',{
            text:'Hello from javascript',
            class:'myClass'

         }).insertAfter('article'); 

      $('&lt;a&gt;&lt;/a&gt;',{

        href:'http://google.com',

      }).insertAfter('article');

    });
</code></pre>
