
Ryan Soeder
11,056 PointsClean console but nothing printing to web page.
Having a hard time understanding why nothing is displaying.
let students = [
{
name: `Francis`,
track: `FEWD`,
acheivements: 58,
points: 987,
},
{
name: `Hermon`,
track: `JavaScript`,
acheivements: 34,
points: 234,
},
{
name: `Banana`,
track: `Python`,
acheivements: 324,
points: 23,
},
{
name: `Jesse`,
track: `Ruby`,
acheivements: 234,
points: 3434,
},
{
name: `Adam`,
track: `Scala`,
acheivements: 324234,
points: 4322342,
}
];
function print(message) {
let output = document.getElementById(`output`);
output.inerHTML = message;
}
function buildList() {
let list = ``;
for (let i = 0; i < students.length; i++) {
list += `<ul>`;
list += `<li><strong>${students[i].name}</strong></li>`;
list += `<li>${students[i].track}</li>`;
list += `<li>${students[i].acheivements}</li>`;
list += `<li>${students[i].points}</li>`;
list += `</ul>`;
}
return list;
}
print(buildList());
Any help appreciated, thanks!
3 Answers

Rich Donnellan
Treehouse Moderator 25,740 PointsTypo.
- output.inerHTML = message;
+ output.innerHTML = message;

Grzegorz Zielinski
5,838 PointsHello :)
You've made a spelling mistake in this bit of code:
function print(message) {
let output = document.getElementById(`output`);
output.inerHTML = message;
}
To be precised - it should be "innerHTML", not "inerHTML".
I hope it helps!

Ryan Soeder
11,056 PointsThank you so much, wonderful people!

Rich Donnellan
Treehouse Moderator 25,740 PointsNo problem.
FYI — I debugged by pasting your code right into Chrome's Dev Tools console. It came back with this error which was easy to pinpoint the mistake:
VM4561:37 Uncaught TypeError: Cannot set property 'inerHTML' of null
at print (<anonymous>:37:19)
at <anonymous>:54:1