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 trialbilly skako
137 Pointsgive me the FREAKING ANSWER!
PLEASE HELP IM NEW!!!!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
</body>
<script>
document.write(<h1>"Welcome to my site"</h1>);
</script>
</html>
2 Answers
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsYou were close..
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
</body>
<script>
// Write your code here.
document.write("Welcome to my site");
</script>
</html>
Vince Jose
1,671 PointsThis is correct if he just wants to show the plain "Welcome to my site". Although if he wants the h1 to work, it should be ("<h1>Welcome to my site</h>");
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsYes, but the challenge does not ask you to add a <h1>
Vince Jose
1,671 PointsI see. I am sorry, you are correct. I did not know that I can view the challenge until now, so I thiught <h1> was really there LOL. I have also just started javascript and currently on my 3rd week. :)
Ming Jun Lim
10,060 PointsHi, the problem lies in this line of your code
document.write(<h1>"Welcome to my site"</h1>);
<h1> and </h1> has to be inside the quotation " "
Basically document.write writes directly to the html code. When u do this, the script will write Welcome to my site into the html code.
document.write("<h1> Welcome to my site </h1>");
When the tag is within the quotation, the script will write <h1> Welcome to my site </h1> into the html code. This allows the h1 tag to work.
Hope this helped u :P
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsHi billy skako
I understand that you are new and learning code can be frustrating, but "yelling" demands in the community is not the way to get someone to help you or be to respected.
A descriptive title to your post, as well as a very descriptive and detailed explanation as to the problem you are having (including your code), the task's instructions, and any errors you are receiving is the proper way to post in the Community Forum and the best way to get proper assistance from other students.
Please keep this in mind and be respectful in the Community.
Thank you.
Jason ~Community Moderator