我在我的HTMLjQuery的1.7.2 - 在IE selector.val()場所8
<div class="selection">
<p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am solely responsible for the decision">I am solely responsible for the decision </p>
<p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am partially responsible for or influence the decision">I am partially responsible for or influence the decision </p>
<p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am not involved in the decision">I am not involved in the decision </p>
<p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="Don't know">Don't know </p>
</div>
並檢查形狀進展的功能下面塊的基礎上,選擇的選項,用下面的代碼段:
var decisionmaker = $('#custrecord_npsdtl_decision:checked').val();
if (decisionmaker == elements['customlist_nps_decision'][2] || decisionmaker == elements['customlist_nps_decision'][3]) {
redirect();
}
這在Chrome,Firefox中按預期工作,但在Internet Explorer(8)中不起作用。做一些檢查我發現
$('#custrecord_npsdtl_decision:checked')
返回一個對象,如預期的那樣,但是調用對象的val()返回undefined。
我絕對困惑。如何從IE的收音機列表中選擇選項?
我明白了。很好的解釋,從jquery文檔不清楚。謝謝! –