私のフォームに2つのステップがあり、以下のコードのように記入してください。通常のボタンをラジオボタンとして使用して、いずれかを選択解除することができます(jQueryを切り替えます)
ステップごとに1つのボタンだけが「ボタン選択」クラスを持つことができます。 "button-choose"クラスで別のボタンを押すと、以前に選択されたボタンは "button-choose"クラスに戻って、新たにクリックされたボタンは "button-selected"クラスに切り替える必要があります。
ボタンが既に選択されているボタンをクリックすると、「ボタン選択」に戻ります。これらはすべてjQueryを使用しています。
<div id="step-one">
<div class="box">
Information
<input type="button" class="button-choose" />
</div>
<div class="box">
Information
<input type="button" class="button-chosen" /> <!-- A button that the visitor has clicked -->
</div>
<div class="box">
Information
<input type="button" class="button-choose" />
</div>
</div>
<div id="step-two">
<div class="box">
Information
<input type="button" class="button-choose" />
</div>
<div class="box">
Information
<input type="button" class="button-chosen" /> <!-- A button that the visitor has clicked -->
</div>
<div class="box">
Information
<input type="button" class="button-choose" />
</div>
</div>
各.box-containerに複数のボタンがある場合、この方法を使用する方法はありますか? 「ボタン選択」または「ボタン選択」クラスのクラスのみがクリック機能の影響を受けるはずの2つのボタンがあります。これを以前言及してくれなかったことに申し訳ありません。 http://jsfiddle.net/ajBtg/4/ – estrar
この[FIDDLE](http://jsfiddle.net/ajBtg/6/)のような、すべてのボタンではなく、その2つの特定のクラスをターゲットにする必要があります。 ..... – adeneo
うわー、ありがとう!まさに私が望んでいたもの。 – estrar