How to operate on the result set of .find?
The following code does not work, but I cannot figure out why. Nothing is even saved to console, soI do not know how to debug it.
-
$('li').find('#important_item').each(function() {
$(this).css({
'border': '1px solid blue'
});
console.log(this);
console.log($(this));
});
Secondly,
Do I have to use .each to operate the result of .find? Or is there a way to include an anonymous function directly in .find? (example: $('li').find('#important_list_item_1', function() { // function content} );