-
Notifications
You must be signed in to change notification settings - Fork 1
/
alerts.html
31 lines (30 loc) · 1.43 KB
/
alerts.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>JS Tutorial - Educational Websites</title>
<script>function exampleAlert(){
alert("This is an alert");
}
</script>
</head>
<body>
<section>
<h1 id="intro">J<span>ava</span>S<span>crip</span>t Tu<span>tori</span>al</h1><br><br><br>
<!-- Lesson 2 -->
<h2 id="lesson-text">Lesson 7 - Alerts</h2><br><br><br>
<h3 id="lesson-text2">You might have heard about modals. They are HTML CSS only popups that you can make. they usually take up lots of divs and are very big to make. But what if i told you that you can make the same in JS, using only 1 line of code? May i present : The Alert.<br><br>
The Alert is a modal which removes style for efficiency. It is triggered like <code>alert("You message");</code>. If you want to show a variable, it is like <code>alert(variableName);</code>. The code for arrays is also the same. <code>alert(arrayName[0]);</code>
<br>
<br>
<button onclick="exampleAlert()">Click here to see an alert</button>
<br>
<br>
<br>
<a href="./document.html" class="green-btn">< Previous</a><span style="color:transparent;">-------------------------</span>
<a href="./errors.html" class="green-btn">Next ></a>
</h3>
</section>
</body>
</html>