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

Opposite of .parent() in jQuery

  • Hi,

    This might sound completely stupid but i cannot remember if there is a way to get an element inside of another eg:

    <p class=\"clickable\">
    <p class=\"toMove\">

    </p>

    </p>


    So you click the clickable tabe and the one inside will open/close

    Regards
  • $("p.clickable").click(function() {

    $(this).children(".toMove").animate(blar blar);

    });

    Something like that would prob set you on the right path...
  • you can also use .find()