Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKevin Murphy
24,380 PointsFirefox innerText undefined - Teacher's Note
Heads up if you are using FF you will experience an error in this stage as innerText is not implemented by Mozilla - There is a teacher's note that provides a work-around -- Thanks @Andrew Chalkley for including that note - I would have been lost without it.
Note additionally that the example is for the edit button but the delete and the label will also require the conditional as well.
if (typeof editButton.innerText === "undefined") {
editButton.textContent = "Edit";
} else {
editButton.innerText = "Edit";
}
if (typeof deleteButton.innerText === "undefined") {
deleteButton.textContent = "Delete";
} else {
deleteButton.innerText = "delete";
}
if (typeof label.innerText === "undefined") {
label.textContent = taskString;
} else {
label.innerText = taskString;
}
If you're not worried about special character rendering or x-browser compatibility substituting innerHTML for innerText will work also.