How does the html reference the JS? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How does the html reference the JS?

I can't seem to use getContext with this app

3rd Sep 2022, 6:00 PM
å”ę°č±Ŗ
å”ę°č±Ŗ - avatar
2 Respostas
0
You can find it by document.getElementById("id")
3rd Sep 2022, 6:47 PM
AjaraGuju
AjaraGuju - avatar
0
you have to wrap you javascript inside window.onload = () =>{ *** your code ** } in the javascript tab, to make sure the html is loaded first so that the javascript can find the DOM elements.
4th Sep 2022, 1:24 PM
Bob_Li
Bob_Li - avatar