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 Answers
0
You can find it by document.getElementById("id")
3rd Sep 2022, 6:47 PM
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š²
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š² - 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