在下面的 HTML 中,我需要根据 p_code 属性检索 p_id 属性。例如:
如果我有“WH15”的 p_code,我需要返回“63”。
我将如何使用 jQuery 来做到这一点?
<div id="deslist_13" class="sch_accordion_item_content_active" style="display: block;">
<div class="left_shadow"></div>
<div p_code="BRE" id="pdiv_60" p_id="60" class="program odd">
<input type="hidden" id="hidden_60" value="BRE">
<input type="hidden" id="tabId_60" value="13">
<div class="cb"></div><span>BRE</span>
</div>
<div p_code="WH13" id="pdiv_61" p_id="61" class="program">
<input type="hidden" id="hidden_61" value="WH13">
<input type="hidden" id="tabId_61" value="13">
<div class="cb"></div><span>WH13</span>
</div>
<div p_code="WH14" id="pdiv_62" p_id="62" class="program odd">
<input type="hidden" id="hidden_62" value="WH14">
<input type="hidden" id="tabId_62" value="13">
<div class="cb"></div><span>WH14</span>
</div>
<div p_code="WH15" id="pdiv_63" p_id="63" class="program">
<input type="hidden" id="hidden_63" value="WH15">
<input type="hidden" id="tabId_63" value="13">
<div class="cb"></div><span>WH15</span>
</div>
<div p_code="BPA" id="pdiv_64" p_id="64" class="program odd">
<input type="hidden" id="hidden_64" value="BPA">
<input type="hidden" id="tabId_64" value="13">
<div class="cb"></div><span>BPA</span>
</div>
<div p_code="BPR" id="pdiv_65" p_id="65" class="program">
<input type="hidden" id="hidden_65" value="BPR">
<input type="hidden" id="tabId_65" value="13">
<div class="cb"></div><span>BPR</span>
</div>
</div>