16th Feb 2023, 5:54 AM
山 Zed
山 Zed - avatar
5 Respuestas
+ 2
山 Zed What do you mean by on which line? I said write JS code inside that function so after loading html contents JS code will work.
16th Feb 2023, 6:03 AM
A͢J
A͢J - avatar
+ 2
Also document.getElementsByClassName('cat'); returns node list so it should be var catList = document.getElementsByClassName('cat'); for (var i = 0; i < catList.length; i++) { var cat = catList[i]; }
16th Feb 2023, 6:01 AM
A͢J
A͢J - avatar
+ 2
A͢J thank you so much!!
16th Feb 2023, 6:04 AM
山 Zed
山 Zed - avatar
+ 1
Write JS code inside this function window.onload = function() { }
16th Feb 2023, 5:58 AM
A͢J
A͢J - avatar
0
On which line A͢J ?
16th Feb 2023, 6:00 AM
山 Zed
山 Zed - avatar