Types You Don't Control 12 exercises
Problem

DOM Typing Configuration in TypeScript

Here's an example of adding an event listener to the DOM:


document.addEventListener("DOMContentLoaded", () => { // red squiggly line under document
const app = document.querySelector("#app")!; // red squiggly line under document
app.innerHTML = "Hello World!";
});

However, TypeScri

Loading exercise

Transcript

00:00 In this exercise, we have a document.addEventListener DOM content loaded that has const app equals document.querySelector. But it looks like document is not available, cannot find name document. Your job is to read that error message and try to figure out what is happening and how you can fix the tsconfig.json inside this file

00:19 to make this work, because this is, yeah, this is not a very fun error if you're working on the DOM. You notice that we don't have access to window here, don't have documents, don't have any of those globals that the DOM injects. Good luck.