jquery val() 返回undefined的问题.
alert($('#shipType>input[checked]').val()); <td id="shipType"> <input type="radio" name="questinfo[ship]" value="1" onclick="checkQuestPay()" /> 24小时后收货 <input type="radio" name="questinfo[ship]" value="2" onclick="checkQuestPay()" checked /> 48小时后收货 <input type="radio" name="questinfo[ship]" value="3" onclick="checkQuestPay()" /> 72小时后收货 <input type="radio" name="questinfo[ship]" value="4" onclick="checkQuestPay()" /> 96小时后收货 <input type="radio" name="questinfo[ship]" value="0" onclick="checkQuestPay()" /> 立即收货(限虚拟宝贝)</span> </td>
原来是因为多了p标签和span标签,这提醒我们,标签一定要干净.来自http://www.9qc.com