treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Append?

  • What I want to do is have this in my html:
    <a class=\"name\" href=\"#\">Jamy</a><div class=\"clear\"></div>

    This is my javascript:
        $(document).ready(function(){ 
    $(\"a.name\").append('<div class=\"clear\"></div>');
    })

    The problem I am having is that it puts the <div class="clear"></div> inside the <a> tag. How would I get it to be directly afterwards?
  • Just in case anyone is interested, I was messing around with the code and all I had to change was 'append' to 'after'.
    So the jquery looks like this:
        $(document).ready(function(){
    $(\"a.name\").after('<div class=\"clear\"></div>');
    })