私は、ユーザーがクリックする3つのラジオボタンに基づいて変更したいHTMLコードを少し持ちます。ここでjqueryを使用してonSelect()を更新する
ラジオボタンです:
<input type="radio" name="awardSwitch" value="silver" />
<input type="radio" name="awardSwitch" value="gold" />
<input type="radio" name="awardSwitch" value="platinum" />
私が更新するHTMLは以下の通りです:
<div id="BestCourseforyourGolfGame">
<div class="floatleft">
<textarea name="code" cols="50" rows="6">
<a href="http://foo.com/best/best-of/#BestCourseforyourGolfGame" target="_blank">
<img src="http://foo.com/assets/awards/2010/best-of-2010-silver.jpg" alt="Best Course for your Golf Game" border="0" width="151" height="200" /></a>
</textarea>
</div>
<div class="floatright">
<img src="http://foo.com/assets/awards/2010/best-of-2010-silver.jpg" alt="Best Course for your Golf Game" border="0" width="151" height="200" />
</div>
</div>
基本的に私は、変更したいものを、HTMLのテキスト賢いが、最後のビットでありますイメージ名のこの例では、 "-silver"ですが、選択したラジオボタンに応じて、 "-gold"または "-platinum"に更新します。
ありがとうございます!