title: How to get value of data-flag
body: <p>Community, I have a select drop down which is trying to pass two variables to javascript.  The first variable is (source_id) and the second is (source_flag).</p>
  
  <p>My select looks like the following...</p>
  
  <pre><code>&lt;select id="ticket_source" name="ticket_source" onchange="showEmail(this)"&gt;
  &lt;option value=""&gt;Select Source&lt;/option&gt;
  </code></pre>
  
  <p>I use query to populate remaining options.</p>
  
  <pre><code>$get_sources = mysql_query("select source_id, source_name, source_flag from ticket_source order by source_name ASC");
  while(($source_list = mysql_fetch_assoc($get_sources)))
  {
      echo '&lt;option value="'.$source_list['source_id'].'" data-flag="'.$source_list['source_flag'].'"&gt;'.$source_list['source_name'].'&lt;/option&gt;
  }
  
  &lt;option value="0"&gt;Other&lt;/option&gt;
  &lt;/select&gt;';
  </code></pre>
  
  <p>My javascript will make a hidden div appear.  I'm trying to obtain the value stored in the data-flag attribute, and I'm not quite sure if there is a certain route to do that.</p>
  
  <pre><code>function showEmail(element)
  {
      var id = element.value;
      var divTwo = document.getElementById("ticket_source");
      var flag = divTwo.getAttribute('data-flag');
      alert(flag);
      // Do something with flag...
      var div = document.getElementById("received");
      if(id == 2 || id == 3 || id == 5)
      {
          div.style.display = 'block';
      }
      else
     {
         div.style.display = 'none';
     }
  }
  </code></pre>