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

James Barshaw
4,167 Pointshow do I get a alert box with the same string with my results instead of just text
the loop shows how to do it with a string but I want more experience using the alert function because there is just certain things this course doesn't teach
1 Answer

Mike Mike
Full Stack JavaScript Techdegree Student 10,055 PointsHi James instead of Using "main.innerHTML
main.innerHTML=`<h1>Congrats it was ${randomNumber}</h1>
<h2>You also took ${incorrect} tries</h2>`;>`
use
alert(`Congrats it was ${randomNumber}
You also took ${incorrect} tries`);
sorry to comment 2 weeks late and i hoped this helped