Filtering a set of items by data
<p>Say if've got a set of items with some data on them like this:</p>

<pre><code>&lt;li data-filtro="website, web app"&gt;&lt;a href="trabajos.php?id=84"&gt;&lt;img src="imgs/thumbs/item_tn_84.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-filtro="website, banners"&gt;&lt;a href="trabajos.php?id=131"&gt;&lt;img src="imgs/thumbs/item_tn_131.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-filtro="publicidad"&gt;&lt;a href="trabajos.php?id=22"&gt;&lt;img src="imgs/thumbs/item_tn_22.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-filtro="publicidad"&gt;&lt;a href="trabajos.php?id=45"&gt;&lt;img src="imgs/thumbs/item_tn_54.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>And to filter some of the by their data content matching the value of a variable named 'valor', I'd like to do something like</p>

<pre><code>var $set = $('li').filter(function(index){
    return $(this).data('filtro').indexOf(valor) &gt; -1;
});
</code></pre>

<p>But somehow I can't make it work ... do you guys have two minutes to open my eyes in this?
Thank you in advance!</p>
