Here are some example variables:
var source = $('.container').find('img').attr('src');
var source = $('.container').find('img').attr('href');
var source = $('.container').find('img').html();
for each of those examples, I need to get the actual element from the selector.
the following fails:
source.hide();
end is similar to the functionality I'm looking for, but it doesn't work if the variable returns a string.
end works like this:
$('.container').find('img').css('background', 'red').end().find('.something-else').css('background', 'green');
this works because the css
method is applying styles, not returning information
the following example will fail because the css
is returning the background css:
$('.container').find('img').css('background').end().find('.something-else');