JQuery取消选中div内的所有复选框 [英] JQuery to uncheck all checkboxes within div

查看:91
本文介绍了JQuery取消选中div内的所有复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < div id =termSheetPopup> 
< div style =text-align:center;>
< select id =termSheetType>
< option>内部< /选项>
< option> Borrower Facing< / option>
< / select>
< / div>

< input type =checkboxname =SummaryInformation>汇总资讯< br />
< input type =checkboxname =ProductLegs> Product Legs< br />
< input type =checkboxname =AmortizationOptions>摊销期权< br />
< input type =checkboxname =Values>值< br />
< input type =checkboxname =Rates> Rates< br />
< input type =checkboxname =RatesSpecific>汇率(All-In-Rate,PV01)< br />
< input type =checkboxname =AmortizationSchedule>摊销计划< br />
< input type =checkboxname =SponsorInfo>赞助商/加盟信息< br />
< input type =checkboxname =BorrowerInfo>借款人信息< br />
< input type =checkboxname =SponsorContacts>赞助商/会员联系人< br />
< input type =checkboxname =CashFlows>现金流量< br />
< input type =checkboxname =PrePayment>预付款< br />
< input type =checkboxname =FutureExposure>潜在的未来曝光< br />
< input type =checkboxname =FutureExposureSpecific>潜在未来曝光(仅限最大数量和日期)< br />
< input type =checkboxname =History>历史记录< br />
< / div>

什么是JQuery删除那个div下面的所有复选框?



 <$ c 

取消选中所有复选框(如标题询问):

。$ C> $( '#termSheetPopup')找到( '输入[类型=复选框]:选中')removeAttr( '检查');。

删除所有复选框(如问题询问):

  $('#termSheetPopup')。find('input [type = checkbox]:checked')。remove(); 


<div id="termSheetPopup">
    <div style="text-align:center;">
        <select id="termSheetType">
            <option>Internal</option>
            <option>Borrower Facing</option>
        </select>
    </div>

    <input type="checkbox" name="SummaryInformation">Summary Information<br />
    <input type="checkbox" name="ProductLegs">Product Legs<br />
    <input type="checkbox" name="AmortizationOptions">Amortization Options<br />
    <input type="checkbox" name="Values">Values<br />
    <input type="checkbox" name="Rates">Rates<br />
    <input type="checkbox" name="RatesSpecific">Rates (All-In-Rate, PV01)<br />
    <input type="checkbox" name="AmortizationSchedule">Amortization Schedule<br />
    <input type="checkbox" name="SponsorInfo">Sponsor/Affiliate Info<br />
    <input type="checkbox" name="BorrowerInfo">Borrower Info<br />
    <input type="checkbox" name="SponsorContacts">Sponsor/Affiliate Contacts<br />
    <input type="checkbox" name="CashFlows">Cash Flows<br />
    <input type="checkbox" name="PrePayment">Pre-Payment<br />
    <input type="checkbox" name="FutureExposure">Potential Future Exposure<br />
    <input type="checkbox" name="FutureExposureSpecific">Potential Future Exposure (Max Number and Date Only)<br />
    <input type="checkbox" name="History">History<br />
</div>

What's the JQuery to delete all those checkboxes just underneath that div?

解决方案

To uncheck all the checkboxes (as the title asks):

$('#termSheetPopup').find('input[type=checkbox]:checked').removeAttr('checked');

To delete all the checkboxes (as the question asks):

$('#termSheetPopup').find('input[type=checkbox]:checked').remove();

这篇关于JQuery取消选中div内的所有复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆