如何通过js实现逻辑表单 需要判断input选中项 显示相应内容
点击#step1-next之后,判断input[name='equipment'],只有当value="laptop"时,才显示div#step2-laptop
<div class="slidebox" id="step1">
<form id="option1">
<input type="radio" name="equipment" id="" class="optioninput" value="laptop">
<input type="radio" name="equipment" id="" class="optioninput" value="monitor">
<input type="radio" name="equipment" id="" class="optioninput" value="laptopmonitor">
<input type="radio" name="equipment" id="" class="optioninput" value="monitormonitor">
<input type="submit" id="step1-next" value="NEXT" onclick="step1()">
</form>
</div>
<div class="slidebox" id="step2-laptop">
<form id="option2">
<input type="radio" name="lightyon" id="" class="optioninput">
<input type="radio" name="lightyon" id="" class="optioninput">
<input type="radio" name="lightyon" id="" class="optioninput">
</form>
</div>
<script>
function step1(){
var step1option = $("input[name='equipment']:checked").val();
if(step1option == "laptop"){...}
}
</script>