Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialrb54
4,087 PointsWhy does my Browser only seem to recognize two elements Body and Header but not Main
document.querySelector('main').innerHTML = xxx will not run in Browser but if I replace main with body it does place the xxx on the web page. When I look at the elements it seems like only Body and Header are available.
1 Answer
babyoscar
12,930 PointsAre you using your own webpage? If you are, you need to create a main
element in your HTML for that to work. You can create one by typing <main></main>
inside the <body>
tag. Hope this helped!
AHARON YOSEF
2,413 PointsAHARON YOSEF
2,413 PointsI have the same issue, and I am not using my own webpage.