How do I use .filter to return multiple values? <p>Say I have a div, with some CSS and javascript:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var someCSS = { color: 'red', }; $(".test &gt; .sub").filter(function(index) { return $(this).text() == 'hello'; }).css(someCSS);</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>.test { color: green; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class='test'&gt; &lt;div class='sub'&gt;hello&lt;/div&gt; &lt;div class='sub'&gt;stackoverflow&lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>The above will color the 'hello' red, but I don't understand how to add more values, eg 'hello' and 'stackoverflow'. I obviously can't do <code>return $(this).text() == 'hello' || 'stackoverflow';</code>, but I just can't figure out what to do!</p> <p>Any suggestions will be appreciated :)</p>