Unable to access HTML element using javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Unable to access HTML element using javascript

Hello, I am trying to access an element using javascript, but an error occurs, and I can’t figure out why. Can somebody help? https://code.sololearn.com/WMtUGtbe1z3j/?ref=app Regards Ben

22nd Oct 2019, 12:16 AM
Ben
2 Answers
0
Well I think that is not an error. Try to add: status.innerText = "hello"; Also, an element is an object. So normally, the console.log() returns object if you use an element as parameter.
22nd Oct 2019, 12:31 AM
Nootnoot
Nootnoot - avatar
0
console.log(status.innerText);
22nd Oct 2019, 3:30 AM
Calviղ
Calviղ - avatar