<p>A <code>.container</code> can contain many <code>.components</code>, and <code>.components</code> themselves can contain <code>.containers</code> (which in turn can contain .components etc. etc.)</p>

<p>Given code like this:</p>

<pre><code>$(".container .component").each(function(){
  $(".container", this).css('border', '1px solid #f00');
});
</code></pre>

<p>What do I need to add to the line within the braces to select only the nested <code>.containers</code> that have their <code>width</code> in CSS set to <code>auto</code>?  I'm sure it's something simple, but I haven't really used jQuery all that much.</p>

[{'answer_id': 43933, 'author': 'travis', 'author_id': 1414, 'author_profile': 'https://Stackoverflow.com/users/1414', 'pm_score': 2, 'selected': False, 'text': '<pre><code>$(".container .component").each(function() {\n    if ($(".container", this).css(\'width\') === "auto")\n        $(".container", this).css(\'border\', \'1px solid #f00\');\n});\n</code></pre>\n'}, {'answer_id': 43937, 'author': 'David McLaughlin', 'author_id': 3404, 'author_profile': 'https://Stackoverflow.com/users/3404', 'pm_score': 5, 'selected': True, 'text': '<pre><code>$(".container .component").each(function()\n{\n    $(".container", this).each(function() {\n        if($(this).css(\'width\') == \'auto\')\n        {\n            $(this).css(\'border\', \'1px solid #f00\');\n        }\n    });\n});\n</code></pre>\n\n<p>Similar to the other answer but since components can also have multiple containers, also needs the .each() check in here too for the width.</p>\n'}, {'answer_id': 8934795, 'author': 'anon', 'author_id': 731352, 'author_profile': 'https://Stackoverflow.com/users/731352', 'pm_score': 4, 'selected': False, 'text': "<p>You may want to look into <code>.filter()</code>.</p>\n\n<p>Something like:</p>\n\n<pre><code>$('.container .component .container')\n.filter(function() {return $(this).css('width') == 'auto';})\n.css({border: '1px solid #f00'});\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/43926', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2268/']