This article mainly introduces the implementation of the provincial/municipal level-2 linkage drop-down menu based on javascript, which has some reference value, interested friends can refer to the examples in this article to share with you the code for implementing the level-2 linkage drop-down menu in js for your reference. The details are as follows:
Js Code:
/** National second-level urban linkage js version */function Dsy () {this. items ={};} Dsy. prototype. add = function (id, iArray) {this. items [id] = iArray;} Dsy. prototype. exists = function (id) {if (typeof (this. items [id]) = "undefined") return false; return true;} function change (v) {var str = "0"; for (I = 0; I
0 |! V) {if (dsy. Exists (str) {ar = dsy. Items [str]; for (I = 0; I
Html code:
Second-level linkage between cities nationwideSecond-level linkage between cities nationwide