Select label drop-down list secondary linkage cascade example code_javascript skills
WBOY
Release: 2016-05-16 17:01:17
Original
1267 people have browsed it
First, from the server side, bind the drop-down list, and the text naming of the second-level drop-down is added with the ID of the first-level drop-down according to certain rules.
var options=new Array(); $ (document).ready(function(){ =''; });//Put the option list To the array $('#ddlPages option:gt(0)').remove(); //Clear the drop-down $('#ddlSubsystems').bind('change',function(){ / /Register event var systemname=$('#ddlSubsystems option:selected').text(); for(var j=0;j ddlPages').append(options[j]);
var textname=$(this).text(); var index=textname.indexOf('-' systemname); if(index<0){ $(this).remove (); $('#ddlPages'). val(0); // The first row is selected by default });
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