私が jQuery でやろうとしているのは、同じグループ内の 3 つのラジオ ボタンを互いに使用できるようにすることです。1 つを選択すると、他の 2 つがアクティブになることはありません。jQuery を使用して最終結果に HTML の個別のブロックを表示できるようにしたいのですが、作業しているもので簡単に実行できるものを取得できません。
現時点で作業する必要があるコードは次のとおりです。
$(document.ready(function()
{
$("input[name='rdiobut']").change(function(){
if ($("input['rdiobut']:checked".val() == 'a'))
$("#rdiocont").text("There is no expiration date.");
else if ($("input[name='rdiobut']:checked".val() == 'b'))
$("#rdiocont").text("Tell me how many days until expire");
else ($("input[name='rdiobut']:checked".val() == 'c'))
$("#rdiocont").text("Pick the date to expire from a calendar");
});
});
jQuery が移動するテーブルは次のとおりです。
<tr><td>Expire Settings:</td><td>Does Not Expire: <input type="radio" name="rdiobut" value="a" checked="check" /> <strong>OR</strong> Expires By Days <input type="radio" name="rdiobut" value="b" /> <strong>OR</strong> Select a Date to Expire On <input type="radio" name="rdiobut" value="c" /></td></tr><tr id="rdiocont"><td>No Expiration Date</td></tr><tr id="rdiocont"><td>Expires by Days</td></tr><tr id="rdiocont"><td>Choose Expiration by Calendar</td></tr>
私が間違っているかもしれないことについて誰かアドバイスや考えがありますか?