Skip to content

find() and children() #12

Open
Open
@iamajoe

Description

@iamajoe

Tried to use these two Sizzle methods and didn't work.

Sometimes you don't want to give an absolute path to the element. For example, if you have a list and you want to iterate through all the items and retrieve one value from a specific div inside of each one.

The code i'm using:

$.getPage(function (page) {
    // Iterate over each 'h2 a' elements.
    $('.ti').each(function (index, element, done) {
        this.children('a', function () {
            // this should now be te 'a' inside '.ti'
            done();
        });
    },
    // This method is called after all the items have been iterated over...
    function () {
        $.close();
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions