title: How to get attribute from selected option of select in jQuery?
body: <p>I have the next <strong>selectbox</strong> in HTML:</p>
  
  <pre><code>&lt;select id="listbox-taskStatus" class="selectpicker"&gt;
      &lt;option status="0"&gt;In progress&lt;/option&gt;
      &lt;option status="1"&gt;Not started&lt;/option&gt;
      &lt;option status="2"&gt;Done&lt;/option&gt;
      &lt;option status="3"&gt;Failed&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want to read the attribute value from selected option.</p>
  
  <p>If just to take the value, it's simple:</p>
  
  <pre><code>var value = $('#listbox-taskStatus').val();
  </code></pre>
  
  <p>But what should I do, if I want to get the attribute value from selected option?
  I know, that <strong>.attr()</strong> must help, but when I tried to use it I've got the incorrect result.</p>
  
  <p>I've tried the next:</p>
  
  <pre><code>var status = $('#listbox-taskStatus option').attr('status');
  </code></pre>
  
  <p>But the returned value is always <code>0</code> despite on fact I was selecting different option.</p>
  
  <p>What's wrong, how to solve my problem?</p>