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 trialKim Dallas
11,461 PointsI need a mentor.
I need help understanding the symbols used in programming. I understand the call function of (), I understand what variables are. but i'm getting stuck with everything else. is there something I can read or do to improve my skills so I can get thru this class? I understand every language has it's syntax. i'm trying to work my way thru wordpress now. I really appreciate everyone's help. I cannot lose this opportunity. thank you
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
<body>
"alert ("I DID IT!");<>/script>.
</html
2 Answers
jobbol
Full Stack JavaScript Techdegree Student 17,885 PointsAs far as syntax is concerned, the majority of HTML tags consist of opening and closing tags. A few of these are known as self closing tags.
In your code html, head, and body
all require a closing tag. Some self-closing tags are meta, br, and doctype
.
So set it up like this...
<html>
<head>
</head>
<body>
</body>
</html>
Then when you have a tag inside a tag, such as head and body being inside html, this is known as nesting. By convention you tab over nested tags for readability.
<html>
<head>
</head>
<body>
</body>
</html>
When you want to use Javascript inside an HTML file, it must be inside a <script> tag which is not self closing. You also usually want to put script tags at the bottom of the body, as it can cause the page to delay loading if it's a long script.
<script>
alert("I did it.");
</script>
Just work on that and you'll be off to a good start.
For further reading. https://www.w3schools.com/html/html_elements.asp
Kim Dallas
11,461 Pointsthank you josh. it still won't accept my alert