title: jquery function select custom attribute from select box
body: <p>I am trying to get the custom attribute values from the select box.  It is triggered by a checkbox click which I already have working.  I can get the name and value pairs just fine.  I want get the custom attributes (therapy) (strength) (weight) and (obstacle) from the option value lines. is this possible?</p>
  
  <p><strong>select box</strong></p>
  
  <pre><code>&lt;option value="2220" therapy="1" strength="1" weight="0" obstacle="0"&gt;Supine Calf/Hamstring Stretch&lt;/option&gt;
  &lt;option value="1415" therapy="0" strength="0" weight="0" obstacle="0"&gt;Sitting Chair Twist&lt;/option&gt;
  &lt;option value="1412" therapy="0" strength="0" weight="0" obstacle="0"&gt;Static Abductor Presses&lt;/option&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>// exercise list filter category         
  jQuery.fn.filterByCategory = function(checkbox) {
          return this.each(function() {
              var select = this;
              var optioner = [];
  
              $(checkbox).bind('click', function() {
  
                  var optioner = $(select).empty().scrollTop(0).data('options');
  
                  var index=0;
                  $.each(optioner, function(i) {
  
                      var option = optioner[i];
                      var option_text = option.text;
                      var option_value = parseInt(option.value);
  
                          $(select).append(
                             $('&lt;option&gt;').text(option.text).val(option.value)
                          );
  
                      index++;
                  }); 
              });
          });
      };
  </code></pre>