以下のようなラジオボタンがチェックされているときにdivセクションを折りたたむ方法を知りたいだけです
セクションを折りたたむためにチェックしたいラジオボタン
<div>
@Html.RadioButtonFor(model => model.Transaction.PaymentProvider, "2")
@Html.LabelFor(model => model.Transaction.PaymentProvider, "Pay with Credit Card")
</div>
上のラジオボタンがチェックされている場合、折りたたまれたいセクション
<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からデバッグされているコードです