How to check if there exists at least one li element with attr = something?
<p>So I want to check if there is any li element that has a attribute of "data-foo" and its value is "bar".</p>

<p>Would this work? :</p>

<pre><code>if ($('li[data-foo=bar]'))
{
//exists
}
else
{
//does not exist
}
</code></pre>

<p>Thanks</p>
