jQuery->get id from other attribute
<p>In the HTML below, I need to retrieve the p_id attribute based on the p_code attribute.
For example:</p>

<p>If I have p_code of "WH15", I need "63" returned.</p>

<p>how would I do that using jQuery?</p>

<pre><code>&lt;div id="deslist_13" class="sch_accordion_item_content_active" style="display: block;"&gt;
    &lt;div class="left_shadow"&gt;&lt;/div&gt;
    &lt;div p_code="BRE" id="pdiv_60" p_id="60" class="program odd"&gt;
      &lt;input type="hidden" id="hidden_60" value="BRE"&gt;
      &lt;input type="hidden" id="tabId_60" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;BRE&lt;/span&gt;
    &lt;/div&gt;
    &lt;div p_code="WH13" id="pdiv_61" p_id="61" class="program"&gt;
      &lt;input type="hidden" id="hidden_61" value="WH13"&gt;
      &lt;input type="hidden" id="tabId_61" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;WH13&lt;/span&gt;
    &lt;/div&gt;
    &lt;div p_code="WH14" id="pdiv_62" p_id="62" class="program odd"&gt;
      &lt;input type="hidden" id="hidden_62" value="WH14"&gt;
      &lt;input type="hidden" id="tabId_62" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;WH14&lt;/span&gt;
    &lt;/div&gt;
    &lt;div p_code="WH15" id="pdiv_63" p_id="63" class="program"&gt;
      &lt;input type="hidden" id="hidden_63" value="WH15"&gt;
      &lt;input type="hidden" id="tabId_63" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;WH15&lt;/span&gt;
    &lt;/div&gt;
    &lt;div p_code="BPA" id="pdiv_64" p_id="64" class="program odd"&gt;
      &lt;input type="hidden" id="hidden_64" value="BPA"&gt;
      &lt;input type="hidden" id="tabId_64" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;BPA&lt;/span&gt;
    &lt;/div&gt;
    &lt;div p_code="BPR" id="pdiv_65" p_id="65" class="program"&gt;
      &lt;input type="hidden" id="hidden_65" value="BPR"&gt;
      &lt;input type="hidden" id="tabId_65" value="13"&gt;
      &lt;div class="cb"&gt;&lt;/div&gt;&lt;span&gt;BPR&lt;/span&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>
