title: jQuery adding additional data to dynamically created select option
body: <p>I am populating a select element dynamically through an ajax call that returns a JSON object with several attributes like so:</p>
  
  <pre><code>$.ajax({
          type: "GET",
          url: "get_data.php",
          data: {value:someValue},
          dataType: "json", 
          cache: false,
          success: function(dataSet){
              $("#mySelect").empty().append('&lt;option value=""&gt;default option&lt;/option&gt;');
              if (!$.isEmptyObject(dataSet)){
                  $.each(dataSet, function(i, data){
                      var option = $("&lt;option&gt;");
                      option.val(data.id);
                      option.text(data.description);
                      option.data("test", 1);
                      $("#mySelect").append(option);
                  });
              }
  
              $("#mySelect").removeAttr("disabled");
          },
          error: function(data){
              alert("Populate mySelect Error: " + data.error);
          }
      });
  </code></pre>
  
  <p>The bit about option.data("test", 1) was me playing around with the idea of adding additionally returned attributes to my dynamically created option elements. This doesn't seem to be working. Any insight on how I can get my additional data attached to my option elements? I'm pretty new to jQuery and client side scripting, so any help is greatly appreciated!</p>