16th Feb 2023, 5:54 AM
ć±± Zed
ć±± Zed - avatar
5 Respostas
+ 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