ここに私のラジオボタンがあります:
<div style="float: left; margin-top: 35px; margin-left: 38px;">
<input type="radio" name="cat" class="styled" value="jersey" />
</div>
<div style="float: left; margin-left: 58px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="shorts" />
</div>
<div style="float: left; margin-left: 58px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="shirts" />
</div>
<div style="float: left; margin-left: 58px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="reversible" />
</div>
<div style="float: left; margin-left: 88px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="outerwear" />
</div>
<div style="float: left; margin-left: 88px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="helmets" />
</div>
<div style="float: left; margin-left: 68px; margin-top: 35px;">
<input type="radio" name="cat" class="styled" value="other" />
</div>
特定のラジオボタンが選択されている場合、そのラジオボタンに固有のコンテンツが表示される複数のjqueryソリューションを試しました。しかし、私の試みはすべて失敗し、その理由はよくわかりません (他の jquery スクリプトを実行しているので、競合が発生している可能性があります)。
では、例えば…
ラジオボタン"cat"
の値が"helmets"
選択されている場合、 のコンテンツを表示したいと思いますhelmets
。値が に変更された場合は、 を破棄して の内容を表示"other"
しましょう。helmets
"other"
助けてくれてありがとう!