title: Referencing the HTML select control currently being used
body: <p>I have a javascript program to filter a list of things in a HTML select control by typing a regular expression into an input (text) box.  I can do the following to correctly filter a specific select control:</p>
  
  <pre><code>$(function() {
      $('input[data-filterable]').keyup(
          function() {
              filter = new filterlist(document.myform.myselect);   
              filter.set(this.value);
          });
  });
  </code></pre>
  
  <p>but I have used a custom attribute (something one can now do in HTML5) called data-filterable.  The attribute will store the name of the select control that is to be filtered so that JS can use the name of the control to filter the list.  This would be a good idea because I will have a general function to filter any select box rather than a specific one.</p>
  
  <p>Any ideas how I do this?  I need something like this in the HTML:</p>
  
  <pre><code>&lt;input data-filterable='{"to":"#selectbox1"}' size="30" type="text" /&gt;
  </code></pre>
  
  <p>but I'm not sure exactly what I'm doing here and what to do with the JS.</p>
  
  <p>Thanks guys :).</p>