Search code examples
jqueryappendto

CSS appendTo("");


$(document).ready(function(){$("[href]").appendTo(" Click here ...");});

HTML Code

<a href="#"> b </a>

I want to to show it on browser as b Click here ... But i didn't work properly here.


Solution

  • have you tried append instead of appendTo ?

    $(document).ready(function(){$("[href]").append(" Click here ...");});
    

    from my understanding it works like:

    element.append('stuff to append to the element');
    

    vs

    element.appendTo(otherElement);