我有一个数据数组,用于填充三个下拉<select>
框。我的问题是如何从数组中删除相同的值(不是数组本身,而是从下拉列表中删除(或)禁用相同的值)?
例如:
data = {
firstbox_a: ['grpA_1','grpA_2','grpA_3','grpA_4'],
firstbox_b: ['grpB_1','grpB_2','grpB_3','grpB_4'],
grpA_1: ['y','n','un','st'],
grpA_2: ['y','n','un','st'],
grpA_3: ['y','n','un','st'],
grpA_4: ['y','n','un','st'],
grpB_1: ['a','b','avg','unc'],
grpB_2: ['a','b','avg','unc'],
grpB_3: ['a','b','avg','unc'],
grpB_4: ['a','b','avg','unc']
}
grpA_1
具有grpA_4
相同的值。如果我为 选择“y” grpA_1
,则无法选择“y”,方法是禁用或删除grpA_2
to中的值grpA_4
。