-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml_javascript.html
More file actions
280 lines (270 loc) · 15.4 KB
/
html_javascript.html
File metadata and controls
280 lines (270 loc) · 15.4 KB
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>html JavaScript | html</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="media_query.css">
<link rel="stylesheet" href="html_javascript.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Bree+Serif&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
</style>
</head>
<body>
<header>
<nav class="main">
<ul>
<li class="stop_breaking"><i class="fa-solid fa-code"></i> LearnToCode</li>
<li class="list_item"></li>
</ul>
<ul class="list">
<li><a href="">Home</a>
<hr class="active">
</li>
<li class="stop_breaking tutorials">
<a href="">Tutorials <i class="fa-solid fa-arrow-down"></i></a>
<ul class="dropdown">
<li><a href="html.html">HTML</a></li>
<li><a href="">CSS</a></li>
<li><a href="">JavaScript</a></li>
</ul>
</li>
<li><a href="">Videos</a></li>
</ul>
<ul class="list">
<li><a href="sign_up.html" class="signup">SignUp</a></li>
<li><a href="log_in.html" class="login">LogIn</a></li>
</ul>
</nav>
</header>
<div class="thin_nav_strip">
<a href="javascript:void(0);" onclick="sidebar_toggle()">Toggle<i class="fa-solid fa-bars"
onmousedown="return false" onselectstart="return false"></i></a>
<a href="index.html"><i class="fa-solid fa-house"></i></a>
<a href="html.html">HTML</a>
<a href="">CSS</a>
<a href="">JavaScript</a>
</div>
<main>
<!-- Sidebar Navigation,I'm excited about it -->
<div class="side_navbar-outer">
<div class="side_navbar-inner">
<h2>HTML Tutorials</h2>
<a href="html.html">HTML Introduction</a>
<a href="html_heading.html">HTML Headings</a>
<a href="html_paragraph.html">HTML Paragraphs</a>
<a href="html_formatting.html">HTML Formatting</a>
<!-- html links -->
<a href="javascript:void(0);" onclick="links_toggle()">HTML Links <label for="links_dropdown"><i
class="fa-solid fa-bars"></i></label></a>
<!-- <input type="checkbox" id="links_dropdown"> -->
<div class="sidebar_links_dropdown">
<ul class="sidebar_links_dropdown_menu">
<li><a href="html_links/html_links.html">Links</a></li>
<li><a href="html_links/html_links_link_colors.html">Link Colors</a></li>
<li><a href="html_links/html_links_link_bookmarks.html">Link Bookmarks</a></li>
</ul>
</div>
<!-- html images -->
<a href="javascript:void(0);" onclick="images_toggle()">HTML Images <label
for="images_dropdown"><i class="fa-solid fa-bars"></i></label></a>
<!-- <input type="checkbox" id="images_dropdown"> -->
<div class="sidebar_images_dropdown">
<ul class="sidebar_images_dropdown_menu">
<li><a href="html_images/html_images.html">Images</a></li>
<li><a href="html_images/html_image_maps.html">Image Map</a></li>
<li><a href="html_images/html_background_images.html">Background Images</a></li>
<li><a href="html_images/html_picture_element.html">The Picture Element</a></li>
</ul>
</div>
<!-- html tables -->
<a href="javascript:void(0)" onclick="tables_toggle()">HTML Tables <i class="fa-solid fa-bars"></i></a>
<div class="sidebar_dropdown tables_dropdown">
<ul class="sidebar_dropdown_menu">
<li><a href="html_tables/html_tables.html">HTML Tables</a></li>
<li><a href="html_tables/html_table_borders.html">Table Borders</a></li>
<li><a href="html_tables/html_table_sizes.html">Table Sizes</a></li>
<li><a href="html_tables/html_table_headers.html">Table Headers</a></li>
<li><a href="html_tables/html_table_padding_spacing.html">Padding & Spacing</a></li>
<li><a href="html_tables/html_table_colspan_rowspan.html">Colspan & Rowspan</a></li>
<li><a href="html_tables/html_table_styling.html">Table Styling</a></li>
<li><a href="html_tables/html_table_colgroup.html">Table Colgroup</a></li>
</ul>
</div>
<!-- html lists -->
<a href="javascript:void(0)" onclick="lists_toggle()">HTML Lists <i class="fa-solid fa-bars"></i></a>
<div class="sidebar_dropdown lists_dropdown">
<ul class="sidebar_dropdown_menu">
<li><a href="html_lists/lists.html">Lists</a></li>
<li><a href="html_lists/html_unordered_list.html">Unordered Lists</a></li>
<li><a href="html_lists/html_ordered_lists.html">Ordered Lists</a></li>
<li><a href="html_lists/html_other_lists.html">Other Lists</a></li>
</ul>
</div>
<a href="html_block_inline.html">HTML Block & Inline</a>
<a href="html_class.html">HTML Classes</a>
<a href="html_id.html">HTML Id</a>
<a href="html_iframe.html">HTML Iframes</a>
<a href="html_javascript.html">HTML JavScript</a>
<a href="html_file_path.html">HTML File Paths</a>
<a href="html_head.html">HTML Head</a>
<a href="html_layout.html">HTML Layout</a>
<a href="html_responsive.html">HTML Responsive</a>
</div>
</div>
<div class="main_content">
<h2>HTML JavaScript</h2>
<div class="previous_next">
<a href="html_iframe.html" class="previous"><i class="fa-solid fa-angle-left"></i>Previous</a>
<a href="html_file_path.html" class="next">Next<i class="fa-solid fa-angle-right"></i></a>
</div>
<hr class="line">
<p>JavaScript makes HTML pages more dynamic and interactive.</p>
<hr class="line">
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<h1 class="heading">JavaScript</h1>
<button id="a_button">Click</button>
<h2>Date:</h2>
<span id="date"></span>
<h2>Time:</h2>
<span id="time"></span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
<hr class="line">
<div class="the_html_script_tag">
<h2>The HTML <script> Tag</h2>
<p>The HTML <span class="styling_the_span"><script></span> tag is used to define a client-side script (JavaScript). <br>The <span class="styling_the_span"><script></span> element either contains script statements, or it points to an external script file through the <span class="styling_the_span">src</span> attribute. <br>Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content. <br>To select an HTML element, JavaScript most often uses the <span class="styling_the_span">document.getElementById()</span> method. <br>This JavaScript example writes "Hello JavaScript!" into an HTML element with id="demo":</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span>
<span class="blue"><</span><span class="brown">script</span><span class="blue">></span>
</span> <br>
<span>
document.getElementById( "demo" ).innerHTML = "Hello JavaScript";
</span> <br>
<span>
<span class="blue"><</span><span class="brown">/script</span><span class="blue">></span>
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<div class="a_taste_of_javascript">
<p>Here are some examples of what JavaScript can do:</p>
<div class="alpha">
<h2>Example:</h2>
<p>JavaScript can change content:</p>
<div class="beta">
document.getElementById( "demo" ).innerHTML = <span class="brown">"Hello JavaScript!"</span>;
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
<div class="alpha">
<h2>Example:</h2>
<p>It can change style too:</p>
<div class="beta">
<span>
document.getElementById( <span class="brown">"demo"</span> ).style.fontsize= <span class="brown">"25px"</span>;
</span> <br>
<span>
document.getElementById(<span class="brown"> "demo" </span>).style.color = <span class="brown">"red"</span>;
</span> <br>
<span>
document.getElementById( <span class="brown">"demo"</span> ).style.backgroundcolor=<span class="brown">"yellow"</span>;
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
document.getElementById( <span class="brown">"image"</span> ).src=<span class="brown">"picture.gif"</span>;
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<div class="the_html_noscript_tag">
<h2>The HTML <noscript> Tag</h2>
<p>The HTML <span class="styling_the_span">noscript</span> tag defines an alternate content to be displayed to users that have disabled scripts in their browser or have a browser that doesn't support scripts:</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span>
<span class="blue"><</span><span class="brown">script</span><span class="blue">></span>
</span> <br>
<span>
document.getElementById( <span class="brown">"demo"</span> ).innerHTML=<span class="brown">"Hello JavaScript!"</span>
</span> <br>
<span>
<span class="blue"><</span><span class="brown">noscript</span><span class="blue">></span>Sorry, your browser doesn't support JavaScript! <span class="blue"><</span><span class="brown">/noscript</span><span class="blue">></span>
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<!-- Code screen end. -->
<div class="previous_next">
<a href="html_iframe.html" class="previous"><i class="fa-solid fa-angle-left"></i>Previous</a>
<a href="html_file_path.html" class="next">Next<i class="fa-solid fa-angle-right"></i></a>
</div>
<!-- Footer -->
<hr class="line">
<div class="footer">
<button onclick="report_error_toggle()">Report Error</button>
<div class="report_error">
<h3>Report error:</h3>
<p>If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: <span>shaurya.y321@gmail.com</span></p>
</div>
<div class="forum_about">
<a href="">Forum</a> | <a href="about.html">About</a>
</div>
<div class="paragraphs">
<p>LearnToCode is optimized for learning and training. Examples might be simplified to improve
reading
and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but
we
cannot warrant full correctness of all content. While using LearnToCode, you agree to have read
and
accepted our <a href="">terms of use</a>, <a href="">cookie and privacy policy</a>.</p>
<p><a href="">Copyright 1999-2022</a> by Auxilium Info. All Rights Reserved. <a href="">LearnToCode
is
Powered by Auxilium</a></p>
</div>
</div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>