-
Notifications
You must be signed in to change notification settings - Fork 3
/
lesson-4.html
64 lines (55 loc) · 2.01 KB
/
lesson-4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<head>
<!--We're importing some of the generic styles from the last lesson.-->
<link rel="stylesheet"
href="./style.css">
</link>
</head>
<body>
<a href="./index.html">Home</a>
<h1>Lesson 4 - JavaScript</h1>
<div class="info">
<h3>What is JavaScript?</h3>
JavaScript is a language that can be used to dynamically change HTML elements. This makes webpages more
interactive and useful.
<h4>Page Structure</h4>
In these modules, we've put the JavaScript after the HTML content in <script></script> tags.
Sometimes JavaScript will be in another file that's imported when the page loads.
<h4>The Command Line</h4>
When programming in JavaScript, it is useful to view output in the 'console' tab of the developer window (Fn+F12
to view)
<h4> Comments</h4>
A comment is a part of the code that doesn't do anything. They start with // or /* characters.
They don't change what the code does, but can be useful for putting human readable notes in the code.
</div>
<div class="dotted-div">
<h2>Task 1: Hello World</h2>
<p>
Update the JavaScript at the bottom of the page so that the alert reads "Hello World" rather than "This alert is
written in JavaScript!"
</p>
<p>Refresh the page to see your changes.</p>
</div>
<div class="key-takeaways">
<h2>Key Takeaways</h2>
<ul>
<li>I know where to find the JavaScript code within the module pages</li>
<li>I can edit an pop up message</li>
<li>I know what comments look like in JavaScript</li>
<li>I can find the console log in the developer tab.</li>
</ul>
</div>
<a href="./lesson-3.html">
Previous Lesson
</a>
|
<a href="./lesson-5.html">
Next Lesson
</a>
</body>
<script>
/*This is a comment! It doesn't do anything, it's just useful to take notes sometimes :)*/
//This is also a comment!
//TODO: Update this alert to say "hello world!"
console.log("Hello in the console :)")
alert("This alert is written in JavaScript!");
</script>