-
Notifications
You must be signed in to change notification settings - Fork 1
/
prompts.html
36 lines (35 loc) · 1.47 KB
/
prompts.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>JS Tutorial - Educational Websites</title>
<script>function examplePrompt(){
prompt("This is a prompt");
}
</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 10 - Prompts</h2><br><br><br>
<h3 id="lesson-text2">You hve already learnt about alerts. But what if you wanted to collect info froma user, but with the style of an alert?
<br>
<br>
A prompt is just like an alert, but it has a text box with 2 buttons : Ok and Cancel. To get the user info from the prompt, the code is <code>var example = prompt("Message");</code>
<br>
<br>
Prompts are usually used to collect info like name, phone number, etc. They are very helpful in JS to reduce the HTML programming.
<br>
<br>
<button onclick="examplePrompt()">Click here to see a prompt</button>
<br>
<br>
<br>
<a href="./conditional_loops.html" class="green-btn">< Previous</a><span style="color:transparent;">-------------------------</span>
<a href="./copyright.html" class="green-btn">Next ></a>
</h3>
</section>
</body>
</html>