selectedIndex를 기준으로 다음 단계 관련 메뉴의 상위 클래스 ID를 가져옵니다. 코드를 복사합니다
코드는 다음과 같습니다. 다음:
함수 변경 위치(locationid) { document.editForm.smalllocation.length = 0 // document.editForm.dlmc0.length = 0; >document.getElementById("dlmc0 ").length=0; //document.editForm.dlmc0.options[0] = new Option('==선택하세요==','') document .getElementById("dlmc0") .options[0] = new Option('==선택하세요==','')
//alert(locationid) var locationid=locationid; var i; document.editForm.smalllocation.options[0] = new Option('==선택하세요==','') for (i=0;i < onecount; i ) { if (subcat[i][1] == locationid) { document.editForm.smalllocation.options[document.editForm.smalllocation.length] = new Option(subcat [i][0], 하위 고양이[i][2]) } } }
<script></script>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.