0

Simple JavaScript (DOM) code not working

I just finished the Javascript course and I tried on this particular code, but it doesn't work. Is something wrong? Do I need to install something first? CODE: https://code.sololearn.com/W3E97hAKy1fP/?ref=app

4th Nov 2019, 8:22 AM
Isidro Brylle Mutia
Isidro Brylle Mutia - avatar
3 odpowiedzi
+ 6
Or window.addEventListener('load', function () { let username = prompt('ENTER USERNAME'); document.querySelector('.hello').innerHTML = username; });
4th Nov 2019, 10:19 AM
Makzo
Makzo - avatar
+ 5
onload = init; function init() { let username = prompt('ENTER USERNAME'); document.getElementsByClassName('hello')[0].innerHTML = username; }
4th Nov 2019, 9:08 AM
Calviղ
Calviղ - avatar