Using data attributes to filter a select box (using third party JS filtering code)
<p>I am using this relatively simple JS program: </p>

<p><a href="http://www.barelyfitz.com/webdesign/articles/filterlist/" rel="nofollow">http://www.barelyfitz.com/webdesign/articles/filterlist/</a></p>

<p>The program just filters a select box using a text box.</p>

<p>However, I want to jquery and HTML5 data attribute which is different how it was originally used.  I give my text box filterer a data attribute:</p>

<pre><code>&lt;input id="filter_text" name="filter_text" data-filterable="myselect" 
       type="text" /&gt;
</code></pre>

<p>I use the following <code>jquery</code> to get the name of the select box that is to be filtered and then filter the select box:</p>

<pre><code>$(function() {
    $('input[data-filterable]').keyup(function() {
       select_box_name = $($(this).data('filterable'))[0];
       filter = new filterlist(select_box_name);
       filter.set(this.value);
    });
}); 
</code></pre>

<p>which NEARLY works.  You can filter but if you press backspace to de-filter then nothing happens i.e. it doesn't 'unfilter'.</p>

<p>It must be something really small!!</p>

<p>Thank you :).</p>
