<select name="cailiao" id="cl" onchange="gradeChange()" class="form-control">
<option value="2">铝</option>
<option value="1" >铁</option>
</select>
<div class="form-group" id = 'cy' style="display:none;">
<label for="exampleSelect1">冲压进度</label>
<select name="chongya" class="form-control">
<option value="0" selected>未完成</option>
<option value="1" >已完成</option>
</select>
</div>
js部分
function gradeChange(){
var objS = document.getElementById("cl");
var grade = objS.options[objS.selectedIndex].value;
// console.log(grade);
if(grade==1){
document.getElementById("cy").style.display="block";
}else{
document.getElementById("cy").style.display="none";
}
}
评论 (0)