【发布时间】:2014-03-04 18:18:32
【问题描述】:
我希望使用 next() 按类获取图像中自定义属性的值。
$("#chkSell").live('change',function(){
var posType = $(this).next('img[class="qtyImgDD"]').attr('posType');
});
<div class="Sell" style="width: 47px;"><input type="checkbox" fund-id="1" id="chkSell" class="_1"/></div>
<div class="Buy" style="width: 47px;"><input type="checkbox" fund-id="1" id="chkBuy" class="_1"/></div>
<div class="BuySelllbl" style="width: 10px;"><label class="lblBuySell_1" fund-id="1"> </label></div>
<div class="Amt" style="width: 116px;"><input type="textbox" fund-id="1" id="AmtValue" size="8" disabled="disabled"/></div>
<div class="QtyType" style="width: 55px;"><label class="lblQtyType" fund-id="1" ddclass="_1">D</label>
<img src="/Applications/Images/ModelManagement/DropDown_Disabled.gif" fund-id="1" posType="MutualFund" class="qtyImgDD" disabled="disabled" ddclass="_1"/></div>
我想要的是当有人单击 chkSell 复选框并执行 change() 函数以从底部获取 posType 属性值时?
【问题讨论】:
-
你遇到了什么问题??
-
当我明确提出问题并用正确的代码引用和 HTML 表达我的问题时,为什么你会反对我的观点?
标签: jquery custom-attributes attr next