根据预测类型(胜负/大小球),再显示胜负方向是(主队/客队,还是大球/小球)

    1. <div class="step_padding">
    2. <p class="step_title">第三步:选择预测类型</p>
    3. <div>
    4. <label for="team_tab"><input id="team_tab" type="radio" name="types" checked="checked" value="胜负"/>胜负</label>
    5. <label for="big_tab" class="fr"><input id="big_tab" type="radio" name="types" value="大小球"/>大小球</label>
    6. </div>
    7. </div>
    1. <div class="step_padding">
    2. <p class="step_title">第四步:选择胜负方向</p>
    3. <div class="team_box">
    4. <label for=""><input type="radio" name="team" checked/>主队</label>
    5. <label for="" class="fr" ><input type="radio" name="team"/>客队</label>
    6. </div>
    7. <div class="ball_box hide">
    8. <label for=""><input type="radio" name="ball" checked/>大球</label>
    9. <label for="" class="fr" ><input type="radio" name="ball"/>小球</label>
    10. </div>
    11. </div>

    JS如下:

    1. $('input[type=radio][name=types]').change(function() {
    2. var myvalue = $(this).val();
    3. if (myvalue =='胜负') {
    4. $('.team_box').removeClass('hide');
    5. $('.ball_box').addClass('hide');
    6. }else{
    7. $('.ball_box').removeClass('hide');
    8. $('.team_box').addClass('hide');
    9. }
    10. });