Jquery - Apply rule if item contains one string OR another string
<p>Hopefully I can explain this better than I can Google it!</p>

<p>I have a Jquery rule that detects a certain word then applies a class to that elements parent container which works as hoped.
Instead of simply duplicating this rule for additional words I would like to just include them in the rule effectively as an "OR".</p>

<p>This is what I have that works:-</p>

<pre><code>$(".container:contains(Word1)").each(function(){
    $(this).closest("#containerParent").addClass("newClass");
    });
</code></pre>

<p>This is the none-working attempt:-</p>

<pre><code>$(".container:contains(Word1)"|".container:contains(Word2)").each(function(){
    $(this).closest("#containerParent").addClass("newClass");
    });
</code></pre>

<p>As an alternative I could make it a function of course, but I would like to do it "properly" or in a cleaner way.</p>

<p>What do you think?</p>
