我尝试研究它,但找不到适合我需要的东西,我对 JQuery 相当陌生。我需要做什么:我已经用 CSS 隐藏了单选按钮和文本。当用户选择一个部门时,我只想显示单选按钮中的那些项目。但我需要它来响应用户的更改。有什么建议么?
<p>
Sub-Department:
<select id="subdep">
<option>Please Select Sub-Department</option>-->
<option value="Administration">Administration</option>
<option value="inventory">Inventory Control</option>
</select></p>
</div><!--End of Sub-Department-->
<div id=taskcon>
<input type="radio" class="admin" value="Appt Exception"/>Appt Exception
<input type="radio" class="admin" value="Appt Reschedule"/>Appt Reschedule
<input type="radio" class="inventory" value="Inventory Review"/>Inventory Review
<script>
$(document).ready(function(){
var requestlist = document.getElementById("subdep");
var list = requestlist.options[requestlist.selectedIndex].value;
if(list == "Administration"){
$('.admin').slideDown('slow');
}
});
</script>