我创建了一个脚本,可以根据选择的类别更改组合框。问题是该脚本可以在除 Internet Explorer(版本 7+)之外的所有其他浏览器中运行。我没有收到错误消息,这表明 IE 不喜欢 object.innerhtml。我能做些什么来解决这个问题?
工作示例:http ://adcabinetsales.com/style-chooser.html
function ChangeCabinetCollection() {
if (document.getElementById("cabinet_collection").value == "broughton") {
// COPY VALUES
var first = document.getElementById('broughton_styles');
var options = first.innerHTML;
var second = document.getElementById('cabinet_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeDoor("cabinet_selector");
} else if (document.getElementById("cabinet_collection").value == "specialty") {
// COPY VALUES
var first = document.getElementById('cabinet_style');
var options = first.innerHTML;
var second = document.getElementById('cabinet_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeDoor("cabinet_selector");
}
}
function ChangeGraniteCollection() {
if (document.getElementById("granite_collection").value == "new_arrivals") {
// COPY VALUES
var first = document.getElementById('granite_new');
var options = first.innerHTML;
var second = document.getElementById('granite_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeGranite("granite_selector");
} else if (document.getElementById("granite_collection").value == "Specialty Styles") {
// COPY VALUES
var first = document.getElementById('specialty_granite_styles');
var options = first.innerHTML;
var second = document.getElementById('granite_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeGranite("granite_selector");
}
}