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

simple jquery append is not working

  • I want to append this :
    <a class="clickable">CLICK HERE</a>

    This is how:
    ('.portfolio-fs-viewport').append('<a class="clickable">CLICK HERE</a>');

    And i get this error in console:
    SyntaxError: Unexpected token <
  • The only thing that comes to mind is that you aren't starting with a '$'.
    $('.portfolio-fs-viewport').append('<a class="clickable">CLICK HERE</a>');

    If that doesn't work then there is a problem somewhere else in your script.