这是我的代码:
<p><label for="category"><b>Services / Package</b></label>
<select name="category" id="category">
<option value="">-- select --</option>
<option value="GC">General</option>
<option value="RFU">Routine</option>
<option value="HPS">Health</option>
<option value="CRP">Corporate</option>
</select></p>
<!--Level 2 hide-->
<p id="gc" style="display: none;">
<label for="GC"><b>Select Doctor</b></label>
<select name="GC" id="GC">
<option value="">-- select --</option>
<option value="scheduleA">Dr A</option>
<option value="scheduleB">Dr B</option>
</select></p>
<p id="rfu" style="display: none;">
<label for="RFU"><b>Select Doctor</b></label>
<select name="RFU" id="RFU">
<option value="">-- select --</option>
<option value="scheduleA">Dr A</option>
<option value="scheduleC">Dr C</option>
</select></p>
<p id="hsp" style="display: none;">
<label for="HPS"><b>Select Package</b></label>
<select name="HPS" id="HPS">
<option value=" ">-- select --</option>
<option value="msg">Package D</option>
<option value="msg">Package E</option>
</select></p>
<!--Level 3 Show hide-->
<p id="CRP" style="display: none;">Please state at remark</p>
<p id="scheduleA" style="display: none;">Table schedule A</p>
<p id="scheduleB" style="display: none;">Table schedule B</p>
<p id="scheduleC" style="display: none;">Table schedule C</p>
<p id="msg" style="display: none;">Please go to this website</p>
有人可以帮我在此编码上创建jquery或javascript吗。
我尝试使用http://jsfiddle.net/FvMYz/并不得不与其他jquery结合使用,似乎结果无法解决问题
我做了http://jsfiddle.net/6rTa5/
这里的问题:
-从第一选择选项中选择
-从第二选择选项中选择
-div节目
-直接在第一选择选项中再次选择
-div卡在了那里,它没有隐藏,除非我进入上一个选项以选择null然后它就消失了
最佳答案
您要在从中选择一个选项时显示第二个下拉框吗?
第一个下拉列表框?
通过更改第一个下拉菜单的选项,可以取消选择或重置第二个下拉菜单选择的选项?
不确定。请清楚。
关于javascript - 显示隐藏所选选项触发第二个选择选项然后第二个选择选项触发隐藏显示div,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16582005/