在radio中綁定點擊事件


$(".checkss").bind("click", function (e) {
  $(e.target).closest("li").next().find(".checkpf").prop("checked", "checked");
 })

注意一定要用prop否則使用attr時選擇其它組內radio Attr中的checked無法去除

<div style="display: table-cell;vertical-align: middle;">
                    <ul>
                            <li>
                               <span><i class="fa fa-info-circle"></i>社:</span>
                                <label class="normal"><input type="radio" name="35bae2d3-bc87-43c9-bd78-b11bf61e7362" id="3james" value="1" checked="checked">成功</label>
                                <label class="normal"><input type="radio" name="35bae2d3-bc87-43c9-bd78-b11bf61e7362" id="3ww" value="0" class="checkss">失敗</label>
                            </li>
                            <li>
                                <span title="7%+7%"><i class="fa fa-info-circle"></i>金:</span>
                                <label class="normal"><input type="radio" name="6748ed61-892c-4489-b2c9-69b8d290ae59" id="6james" value="1" checked="checked">成功</label>
                                <label class="normal"><input type="radio" name="6748ed61-892c-4489-b2c9-69b8d290ae59" id="6ww" value="0" class="checkpf">失敗</label>
                            </li>
                    </ul>
                </div>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM