- 1

Code playground popping up errors when i input the EXACT code that the SoloL. tutorial told me to

I kind of get what is happening, the js is running before the html structure exists. Is it just the "side by side" function of the Code Playground? using Here's the "sim ple" code: window.onload = function() { var elem = document.getElementsByClassName("a").value; elem.innerHTML='FOUND YOU!!'; }; in the html i am using 2 <div structures with class of a... finally got it to stop calling errors but the inner html thing dont do crap! so what do i do?

21st Nov 2017, 4:18 PM
Black Frost
Black Frost - avatar
3 Answers
+ 3
ClassName returns a list of elements so try elem[0].innerHTML
21st Nov 2017, 4:21 PM
John Wells
John Wells - avatar
+ 1
swimin through bugs but im getting it. thanks for getting back to me!!
21st Nov 2017, 6:40 PM
Black Frost
Black Frost - avatar
0
Post code so we can answer you
21st Nov 2017, 4:20 PM
John Wells
John Wells - avatar