title: if values from one array matches ANY values from another return true
body: <p>I have the jQuery below and when the input values (in array) match the html of .adiv (in array) I get an alert which says true, BUT this only happens if the exactly ALL the values from the two arrays match. what i am trying to do is if ALL of the values from the temp array match ANY of the values from the divar array return true. so for eg. if the .adiv html is <code>this is a div</code> and the input value is <code>this div</code> return true <code>is div</code> return true etc, however if the input value is <code>thisisadiv</code> or for eg <code>isa div</code> OR <code>random words</code> return false. <strong>ALSO</strong> if the temp array contains a word not in the divar array it should return false</p>
  
  <h2><a href="http://jsfiddle.net/7Q4CJ/" rel="nofollow">http://jsfiddle.net/7Q4CJ/</a></h2>
  
  <pre><code>jQuery.fn.compare = function(t) {
      if (this.length != t.length) { return false; }
      var a = this.sort(),
          b = t.sort();
      for (var i = 0; t[i]; i++) {
          if (a[i] !== b[i]) { 
                  return false;
          }
      }
      return true;
  };
  $("button").click(function() {
  
      var inputstr = $(".searchval").val().replace(/ /g, ",");
      var temp = new Array();
      temp = inputstr.split(",");
  
      var dival = $(".adiv").html().replace(/ /g, ",");
      var divar = new Array();
      divar = dival.split(",");
  
      alert($(temp).compare(divar)); 
  });
  </code></pre>
  
  <p>​</p>