如何使用Js填充下拉列表

如何使用Js填充下拉列表

本文介绍了如何使用Js填充下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何填充html子选择ddl根据父html选择ddl使用js



//父ddl有选项。

< ;药水值=数字>数字

<药水值=字母>字母

< potion value =OPERATOR> OPERATOR





//儿童ddl在js数组中有价值



numeric [数字 ] = [ 1\" , 2, 3, 4, 5, 6, 7,...];

alphabetic [alphabetic] = [A,B,C,D,E,F,G,......];

OPERATOR [OPERATOR] = [+, - ,*,%,/,..];

//

how can i populate html child select ddl according parent html select ddl using js

//parent ddl have options.
<potion value="numeric">numeric
<potion value="alphabetic">alphabetic
<potion value="OPERATOR">OPERATOR


//child ddl have value in js array

numeric["numeric"]=["1","2","3","4","5","6","7",...];
alphabetic["alphabetic"]=["A","B","C","D","E","F","G",...];
OPERATOR["OPERATOR"]= ["+","-","*","%","/",..];
//

推荐答案


这篇关于如何使用Js填充下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 14:56