0
I want to Access the heading and display it in console. I have error. Thanks you.
Display heading in a console. https://code.sololearn.com/WHi9TINlqdal/?ref=app
2 ответов
+ 1
Your JavaScript code got executed before the <h1> is loaded, so it return error since it didn't find <h1> in the page.
So, you can run the JS after the page is loaded using onload() like in this example. https://code.sololearn.com/WTHHEukxmtzZ/?ref=app
Or you can paste the JavaScript code at the end of your body tag.
+ 1
In JS tab
window.onload = function(){
//Always put your JS code here.
}