title: Get custom attribute value from multiple select option using Jquery
body: <p>I want to get custom attribute value from multiple select, here is my html,code</p>
  
  <pre><code>&lt;select multiple name="tax[]" id="tax_classes" onChange="getSelectedOptions(this)"&gt;  
     &lt;option value="2" data-percentage="9.00"&gt;CGST(9.00%)&lt;/option&gt;  
     &lt;option value="1" data-percentage="18.00"&gt;GST(18.00%)&lt;/option&gt; 
     &lt;option value="3" data-percentage="9.00"&gt;IGST(9.00%)&lt;/option&gt; 
     &lt;option value="4" data-percentage="12.00"&gt;Tax(12.00%)&lt;/option&gt; 
  &lt;/select&gt;
  </code></pre>
  
  <p>From above tag, I wanted to get the <code>data-percentage</code> attribute value.</p>
  
  <p>Here is the script what i tried so far</p>
  
  <pre><code>function getSelectedOptions(tax) 
  {
    var options = [], option;
    var len = tax.options.length;
    for (var i = 0; i &lt; len; i++) {
      option = tax.options[i]; 
      if (option.selected) { 
        options.push(option); 
        alert(option.value); 
      }
    }  
  } 
  </code></pre>
  
  <p>I am getting output as <code>2,1,3</code>, </p>
  
  <p>But my expected output is
  <code>9.00, 18.00, 9.00 </code> . </p>