Closed terrifricker closed 6 months ago
Ki figured it out! Now we have:
The information had to be made twice:
labels.forEach(item => {
const dlElement = document.createElement('dl');
const dtElement = document.createElement('dt');
const ddElement = document.createElement('dd');
const spanElement = document.createElement('span');
spanElement.textContent = item.label + ':';
ddElement.textContent = item.data;
dlElement.style.marginLeft = "15px";
dtElement.appendChild(spanElement);
dlElement.appendChild(dtElement);
dlElement.appendChild(ddElement);
cardBackText.appendChild(dlElement);
});
labels.forEach(item => {
const dlElement = document.createElement('dl');
const dtElement = document.createElement('dt');
const ddElement = document.createElement('dd');
const spanElement = document.createElement('span');
spanElement.textContent = item.label + ':';
ddElement.textContent = item.data;
dlElement.style.marginLeft = "15px";
dtElement.appendChild(spanElement);
dlElement.appendChild(dtElement);
dlElement.appendChild(ddElement);
mobileCardText.appendChild(dlElement);
});
Add code to onSearch function to create mobile cards at the same time as the desktop cards.
PROBLEM: (solved below) This somehow breaks the desktop cards by not putting the dinosaur information onto the back of the desktop cards. I cannot find where I make a change to that code....
Previous working code:
New code: