-
Notifications
You must be signed in to change notification settings - Fork 0
/
js.html
234 lines (230 loc) · 7.03 KB
/
js.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
---
layout: default
title: Learn JavaScript
custom_css: js
---
<button id="openbtn" class="openbtn" onclick="openNav()">☰</button>
<!-- top menu -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="index.html">Learn Web Dev</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#basics">Basics, DOM & Events</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#cart-example">Shopping Cart Example</a>
</li>
</ul>
</div>
</nav>
<!-- Page content goes here -->
<div class="container-fluid">
<div id="introduction" class="card">
<div class="card-header">Introduction</div>
<div class="card-body">
<p>
JavaScript is a programming language that is commonly used to add
interactivity to websites. It can be used to create dynamic effects,
validate forms, and manipulate HTML and CSS. In this tutorial, you will
learn the basics of JavaScript and how to use it to enhance your
websites.
</p>
</div>
</div>
<div class="card-deck">
<div id="basics" class="card">
<div class="card-header">
<h6>JavaScript Basics</h6>
</div>
<img
class="card-img-top"
src="https://cdn.pixabay.com/photo/2015/04/23/17/41/javascript-736400_960_720.png"
alt="JavaScript image"
/>
<div class="card-body">
<p>
In this section, you will learn the basics of JavaScript, including
variables, data types, operators, arrays, objects, and functions. You
will also learn how to use conditional statements and loops to control
the flow of your code.
</p>
</div>
<div class="card-footer">
<a href="jsbasics.html" class="btn btn-primary">Learn More</a>
</div>
</div>
<div id="events" class="card">
<div class="card-header">
<h6>JavaScript Events</h6>
</div>
<img
class="card-img-top"
src="https://blog.hubspot.com/hs-fs/hubfs/registration%20form%20template%20by%20W3Docs.png?width=600&name=registration%20form%20template%20by%20W3Docs.png"
alt="JavaScript events image"
/>
<div class="card-body">
<p>
JavaScript events are actions that can be detected by your web page,
such as button clicks, mouse movements, and keyboard input. In this
section, you will learn how to create interactive web pages that
respond to user input.
</p>
</div>
<div class="card-footer">
<a href="events.html" class="btn btn-primary">Learn More</a>
</div>
</div>
<div id="dom" class="card">
<div class="card-header">
<h6>Document Object Model (DOM)</h6>
</div>
<img
class="card-img-top"
src="https://cdn.pixabay.com/photo/2016/03/27/18/54/technology-1283624_960_720.jpg"
alt="DOM image"
/>
<div class="card-body">
<p>
The Document Object Model (DOM) is a programming interface for HTML
and XML documents. It represents the page so that programs can change
the document structure, style, and content.
</p>
</div>
<div class="card-footer">
<a href="dom.html" class="btn btn-primary">Learn More</a>
</div>
</div>
<div id="faq" class="card">
<div class="card-header">
<h6>JavaScript FAQ</h6>
</div>
<img
class="card-img-top"
src="https://www.smtusa.com/uploads/faqs.jpg"
alt="FAQ"
/>
<div class="card-body">
<p>
Some of the frequently asked JavaScript questions for your reference.
</p>
</div>
<div class="card-footer">
<a href="challenges.html" class="btn btn-primary">Learn More</a>
</div>
</div>
</div>
<h1 id="cart-example">My Shopping Cart</h1>
<div class="row">
<div class="col-md-8">
<h2>Products</h2>
<div class="row">
<div class="col-md-4">
<div class="card">
<img
class="card-img-top"
src="https://via.placeholder.com/150x150.png"
alt="Product 1"
/>
<div class="card-body">
<h5 class="card-title">Product 1</h5>
<p class="card-text">₹10</p>
<button
class="btn btn-primary add-to-cart"
data-name="Product 1"
data-price="10"
>
Add to Cart
</button>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img
class="card-img-top"
src="https://via.placeholder.com/150x150.png"
alt="Product 2"
/>
<div class="card-body">
<h5 class="card-title">Product 2</h5>
<p class="card-text">₹20</p>
<button
class="btn btn-primary add-to-cart"
data-name="Product 2"
data-price="20"
>
Add to Cart
</button>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img
class="card-img-top"
src="https://via.placeholder.com/150x150.png"
alt="Product 3"
/>
<div class="card-body">
<h5 class="card-title">Product 3</h5>
<p class="card-text">₹30</p>
<button
class="btn btn-primary add-to-cart"
data-name="Product 3"
data-price="30"
>
Add to Cart
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<h2>Cart</h2>
<table class="table">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody id="cart-body"></tbody>
<tfoot>
<tr>
<td colspan="3" align="right">Total:</td>
<td colspan="2" id="cart-total">₹0</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<footer class="navbar navbar-dark bg-dark">
<a class="navbar-brand" href="index.html">Learn Web Dev</a>
<div class="container footer-text text-white">
© 2023 Made with 🤍 by Vikas Bandaru
</div>
</footer>
<a href="#top" id="up-arrow"
><img
class="uparrow"
src="https://cdn3.iconfinder.com/data/icons/faticons/32/arrow-up-01-512.png"
alt="Up Arrow"
/></a>
<script src="assets/js/cart.js"></script>