This article mainly introduces the SELECT Tag Drop-down list level Two linkage Cascade instance code, you need friends can refer to the following
First from the server side, bind the Drop-down list, the level two drop-down of the text name according to a certain rule plus the first level Drop-down ID. The code is as follows: Var options=new Array (); $ (document). Ready (function () { //two-level linkage $ (' #ddlPages '). Children (' option '). each (function (i) { options[i]= ' <option value= ' +$ (This) . val () + ' > ' +$ (This). Text () + ' </option> '; })//SET option list into array $ (' #ddlPages option:gt (0) '). Remove (); //Clear dropdown $ (' #ddlSubsystems '). Bind (' Change ', function () { //Registration Event var systemname=$ (' #ddlSubsystems option:selected '). Text (); for (Var j=0;j<options.length;j++) { $ (' #ddlPages '). Append (Options[j]); { //option list initial $ (' #ddlPAges option:gt (0) '). each (function (i) { //traversal exclusion var text name=$ (This). text (); var index=textname.indexof ('-' +systemname); if (index<0) { & nbsp $ (this). Remove (); }else{ &NB Sp $ (this). Text (textname.substring (0,index)); ( }); $ (' #ddlPages '). val (0); //default selected first line & nbsp }); });