JQuery - how to find all elements matching given strings?
<p>I've stuck with my task.</p>

<p>How to select all <code>&lt;span class="title"&gt;</code> elements on the page:</p>

<pre><code>&lt;div class="my-page"&gt;
    &lt;span class="title"&gt;first&lt;/span&gt;
    &lt;span class="title"&gt;second&lt;/span&gt;
    &lt;span class="title"&gt;third&lt;/span&gt;
    &lt;span class="title"&gt;fourth&lt;/span&gt;
    &lt;span class="title"&gt;fifth&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>that are present on the list (fetched from servlet in JSON format) and stored inside some variable?</p>

<p>I've tried sth like:</p>

<pre><code>success : function(data, statusText, jqxhr) {
  var arr = data.selectedTitles;
    jQuery.each(data.favTools, function(i, v) {
      var title = v;
      jQuery('span.title:contains(title)').css("text-decoration", "underline");
    });
}
</code></pre>

<p>Any suggestion would be greatly appreciated:)</p>
