HTML代码
一级:<select class="operators" name="operators">
<option value="">请选择</option>
<option>华康清远</option>
<option>运营机构001</option><option>运营机构002</option> </select>
二级:<select class="seal_name" name="seal_name">
<option value="">请选择</option>
<option operators="华康清远">印章名称</option>
<option operators="华康清远">印章名称</option>
<option operators="运营机构001">印章名称001</option>
<option operators="运营机构002">印章名称002</option>
</select>
JS代码
<script language="javascript">
$(".operators").change(function(e) {
var operators=$(this).val();
$(".seal_name").find("option").each(function(index, element) {
if($(this).attr('operators')==operators||$(this).attr('operators')==''){
$(this).css('display','block');
}else{
$(this).css('display','none');
}
});
$(".seal_name").val('');
});
</script>