-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.html
114 lines (110 loc) · 7.02 KB
/
blog.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blog</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<!-- font-awesome -->
<script src="https://kit.fontawesome.com/11e1d0c6b3.js" crossorigin="anonymous"></script>
</head>
<body>
<main class="container-lg">
<!-- Frequently Asked Any Questions -->
<section class="px-3 mt-4 rounded">
<h1 class="my-3 text-center w-75 mx-auto">Frequently Asked Questions</span></h1>
<div class="row row-cols-1 row-cols-md-2 mt-5 align-items-center">
<div class="col">
<div class="accordion" id="accordionExample">
<div class="mb-4 accordion-item bg-body-secondary">
<h2 class="accordion-header" id="headingOne">
<button class="bg-body-secondary text-dark accordion-button" type="button"
data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true"
aria-controls="collapseOne">
1. What is DOM and what is the purpose of DOM?
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne"
data-bs-parent="#accordionExample">
<div class="accordion-body">
<h5>Definition</h5>
<li>a programming interface for web documents</li>
<li>programming API for HTML and XML documents</li>
<li>defines the logical structure of documents</li>
<h5>Purpose</h5>
<li>maintain a standard programming interface for HTML and XML documents, which is language-independent</li>
<li>gives languages access to the structure of the document. Made up of series of nodes</li>
<li>allow programs and scripts running in a web client</li>
</div>
</div>
</div>
<div class="mb-4 accordion-item bg-body-secondary">
<h2 class="accordion-header" id="headingTwo">
<button class="bg-body-secondary text-dark accordion-button collapsed" type="button"
data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false"
aria-controls="collapseTwo">
2. How will you select HTML elements using DOM? Name the DOM methods.
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo"
data-bs-parent="#accordionExample">
<div class="accordion-body">
<h5>DOM Selectors</h5>
<li>getElementsByTagName()</li>
<li>getElementsByClassName()</li>
<li>getElementById()</li>
<li>querySelector()</li>
<li>querySelectorAll()</li>
</div>
</div>
</div>
<div class="mb-4 accordion-item bg-body-secondary">
<h2 class="accordion-header" id="headingThree">
<button class="bg-body-secondary text-dark accordion-button collapsed" type="button"
data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false"
aria-controls="collapseThree">
3. What is event bubble?
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree"
data-bs-parent="#accordionExample">
<div class="accordion-body">
<h5>Definition</h5>
<li>a way that events are handled in the browser</li>
<li>a method of DOM event propagation in the HTML DOM API</li>
</div>
</div>
</div>
<div class="mb-4 accordion-item bg-body-secondary">
<h2 class="accordion-header" id="headingFour">
<button class="bg-body-secondary text-dark accordion-button collapsed" type="button"
data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false"
aria-controls="collapseFour">
4. What is a callback function and why will you use it?
</button>
</h2>
<div id="collapseFour" class="accordion-collapse collapse" aria-labelledby="headingFour"
data-bs-parent="#accordionExample">
<div class="accordion-body">
<h5>Definition</h5>
<li>a function passed as an argument to another function</li>
<li>allows a function to call another function</li>
<li>a function which is to be executed after another function has finished execution</li>
<H5>Benefits</H5>
<li>to execute code in response to an event</li>
<li>mostly used in arrays, timer functions, event handlers, etc</li>
<li>keeps us safe from problems and errors</li>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
</body>
</html>