<p>Hello my name is Daniel</p>
<p>I have lots to say</p>
<p>I like cake</p>
<p>But I'll never tell</p>
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
    return function( elem ) {
        return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
    };
});

var things = [ "is", "cake" ];

for (var i = things.length - 1; i >= 0; i--) {
	
  var words = things[i];
   $("p:contains('" + words + "')").hide();

 };
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js