【发布时间】:2020-11-24 17:37:17
【问题描述】:
这是我填充组合框的函数(它的 id 是 bc)
function fillComboBox() {
for(let i=0; i < SemanticTaskPropertySet.types.length; i++) {
let option = document.createElement("option");
option.innerHTML = SemanticTaskPropertySet.types[i].bc;
option.value = SemanticTaskPropertySet.types[i].bc_id;
bc.appendChild(option);
let option2 = document.createElement("option");
option2.innerHTML = SemanticTaskPropertySet.types[i].ti;
option2.value = SemanticTaskPropertySet.types[i].ti;
ti.appendChild(option2);
}
}
行的值:
option.value = SemanticTaskPropertySet.types[i].bc_id;
我得到 bc.value;
但是我怎样才能得到该行的值呢?
option.innerHTML = SemanticTaskPropertySet.types[i].bc;
我试过了:bc.innerHTML;但这不起作用。 提前致谢!
【问题讨论】:
标签: javascript combobox innerhtml