-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
51 lines (45 loc) · 1.63 KB
/
script.js
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
// 02. Alert
// > The alert() method displays an alert box with a message and an OK button.
alert("Hello! I am an JavaScrip alert!!");
// 03. Confirm
// > The confirm() method displays a dialog box with a message, an OK button, and a Cancel button.This method returns true if the user clicked "OK", otherwise false.
confirm("are you going to picnic");
// 04. Prompt
// > The prompt() method displays a dialog box that prompts the user for input. this method returns the input value if the user clicks "OK", otherwise it returns null.
const person = prompt("Please enter your name");
console.log(person);
// 05. setTimeout
// > The setTimeout() sets a timer and executes a callback function after the timer expires.
setTimeout(() => {
console.log("this is the first message");
}, 5000);
// 06. setInterval
// > The setInterval() repeatedly calls a function with a fixed delay between each call.
setInterval(function () {
element.innerHTML += "Hello";
}, 1000);
// 07. Location Object
// > The location object can be used to get the current page address (URL) and to redirect the browser to a new page.
// There are many properties Like: hash, host, hostname, href, origin, pathname;
// 08. Get query string parameters
// 09. Redirect to a new URL
// 10. Navigator Object
// 11. Screen Object
// 12. History Object
// #Web API
// #Client Storage
// 01. Cookies
// 02. localStorage
// getItem, setItem, removeItem, key, clear,
// 03. sessionStorage
// 04. IndexedDB
// #FormData API
// 01. FormData
// #Drag and Drop API
// 01. Drag and Drop API
// 02. FileReader API
// #Geolocation API
// #Notification API
// #Canvas API
// #History API
// #Network Requests