Eventually I am hoping to get an object to display like this:
'0': {
'0': {
label: 'Book:',
content: 'a book name',
},
'1': {
label: 'Video:',
content: 'a video name',
},
'2': {
label: 'Audio:',
content: 'an audio name',
},
},
'1': {
'0': {
label: 'Book:',
content: 'another book name',
},
'1': {
label: 'Video:',
content: 'another video name',
},
'2': {
label: 'Audio:',
content: 'another audio name',
},
}
My code in http://jsfiddle.net/ScbjL/4/ didn’t turn out right, I’m puzzled why objDL is undefined?
You should not iterate over
.containers,dts anddds separately – you are forgetting from which container the objDT/DD is stemming. Also use an array instead of an object for the results.