Get the parent class ID of the next-level associated menu based on selectedIndex, Copy the code
The code is as follows:
function changelocation(locationid) { document.editForm.smalllocation.length = 0; // document.editForm.dlmc0.length = 0; document.getElementById("dlmc0 ").length=0; //document.editForm.dlmc0.options[0] = new Option('==Please select==',''); document.getElementById("dlmc0") .options[0] = new Option('==Please select==','');
//alert(locationid); var locationid=locationid; var i; document.editForm.smalllocation.options[0] = new Option('==Please select==',''); for (i=0;i < onecount; i ) { if (subcat[i][1] == locationid) { document.editForm.smalllocation.options[document.editForm.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]); } }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn