我只是想知道如何在选中下面这样的单选按钮时折叠 div 部分
我要选中以折叠部分的单选按钮
<div>
@Html.RadioButtonFor(model => model.Transaction.PaymentProvider, "2")
@Html.LabelFor(model => model.Transaction.PaymentProvider, "Pay with Credit Card")
</div>
如果选中上面的 Radiobutton,我想要折叠的部分
<div class="panel-body">
<table border="0" cellspacing="0" cellpadding="0" align="middle">
<tr>
<td width="100" border="0" class="paylabel">Card Number:</td>
<td colspan="3" width="335" border="0" class="paylabel">
<div class="editor-field">
@Html.EditorFor(model => model.Transaction.CreditCard.CardNumber)
@Html.ValidationMessageFor(model => model.Transaction.CreditCard.CardNumber)
</div>
</td>
</tr>
</table>
</div>
我正在使用引导程序并尝试了手风琴类,但这仅适用于超链接,如果选中该单选按钮然后解折叠,我不确定如何创建条件
<label class="radio">
<input checked="checked" data-val="true" data-val-number="The field PaymentProvider must be a number." data-val-required="The PaymentProvider field is required." id="Transaction_PaymentProvider" name="Transaction.PaymentProvider" type="radio" value="1"/>
<label for="Transaction_PaymentProvider">Pay with PayPal</label>
<input id="Transaction_PaymentProvider" name="Transaction.PaymentProvider" type="radio" value="2" />
<label for="Transaction_PaymentProvider">Pay with Credit Card</label>
</label>
这是正在从 IE 调试的代码