title: Drupal 7 How to add custom attribute to form?
body: <p>I have a select drop down list and I wanna add custom attribute attached to each option. Basically I wanna make that form look like this.</p>
  
  <pre><code>&lt;select id="audience-segment"&gt;
   &lt;optgroup label="Blog"&gt;
    &lt;option data-targetaud="GENERAL" value="82"&gt;Default&lt;/option&gt;
   &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>How can I add <code>data-targetaud</code> using drupal 7 form API or any other way ?</p>
  
  <p>Regards,</p>