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 trial

JavaScript JavaScript Basics Working with Strings Display the Value of a String on a Page

Liam VanOrden
seal-mask
.a{fill-rule:evenodd;}techdegree
Liam VanOrden
Full Stack JavaScript Techdegree Student 1,194 Points

when i try to call the document.querySelect'main'; in the console it returns unexpected string

const stringToShout = prompt ("What do you want to shout?"); const shout = stringToShout.toUpperCase(); const shoutMessage = the message to shout is: ${shout}!!;

document.querySelector('main');

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

Well everything you have here seems set up good up to about the 4:30 mark of the video but there is more to do than what is written here.

You'll often see people utilizing querySelector() to reference an element on the page to store in a variable, something like this

const mainElement = document.querySelector('main');

but in this video we're trying to change the innerHTML of this element.

document.querySelector('main').innerHTML ... ... ...

I'd keep following along with the video and this should make more sense. :smiley: