JavaScript JavaScript Basics Introducing JavaScript Link to an External Script

Kim Dallas
Kim Dallas
9,263 Points

I 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

index.html
<!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
shout.js

2 Answers

Josh Olson
Josh Olson
12,959 Points

As 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
Kim Dallas
9,263 Points

thank you josh. it still won't accept my alert