Имеется код:
function chapter(){};
var chapters = new chapter;
chapters.dataList = {
'amh_1john':{
'chapter1':'chapter2',
},
};
function Do()
{
var bib;
var chap;
bib = document.getElementById("List2").options[document.getElementById("List2").selectedIndex].value;
chap = document.getElementById("List3").options[document.getElementById("List3").selectedIndex].value;
document.getElementById("tab").innerHTML = chapters.dataList.bib.chap;
}
Проблема в последней строчке:
document.getElementById("tab").innerHTML = chapters.dataList.bib.chap;
Теоретически он должен вставлять в таблицу значение chapters.dataList
Допустим что bib = amh_1john , а chap = chapter1 , то должно вывестись chapter2.
В чем я заблуждаюсь?