How does the html reference the JS? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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 Respuestas
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