forked from kokonior/HTML-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JavaScriptTut
1693 lines (1582 loc) · 94.9 KB
/
JavaScriptTut
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>JavaScript Tutorial</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Keywords" content="HTML, Python, CSS, SQL, JavaScript, How to, PHP, Java, C, C++, C#, jQuery, Bootstrap, Colors, W3.CSS, XML, MySQL, Icons, NodeJS, React, Graphics, Angular, R, AI, Git, Data Science, Code Game, Tutorials, Programming, Web Development, Training, Learning, Quiz, Exercises, Courses, Lessons, References, Examples, Learn to code, Source code, Demos, Tips, Website">
<meta name="Description" content="Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.">
<meta property="og:image" content="https://www.w3schools.com/images/w3schools_logo_436_2.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="436">
<meta property="og:image:height" content="228">
<meta property="og:description" content="W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="preload" href="/lib/fonts/fontawesome.woff2?14663396" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/lib/fonts/source-code-pro-v14-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/lib/fonts/roboto-mono-v13-latin-500.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-700.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-600.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/lib/fonts/freckle-face-v9-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/lib/w3schools30.css">
<!-- Google Tag Manager -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KTCFC3S');
var subjectFolder = location.pathname;
subjectFolder = subjectFolder.replace("/", "");
subjectFolder = subjectFolder.substr(0, subjectFolder.indexOf("/"));
</script>
<!-- End Google Tag Manager -->
<script src="/lib/uic.js?v=1.0.5"></script>
<script data-cfasync="false" type="text/javascript">
var k42 = false;
k42 = true;
</script>
<script data-cfasync="false" type="text/javascript">
window.snigelPubConf = {
"adengine": {
"activeAdUnits": ["main_leaderboard", "sidebar_top", "bottom_left", "bottom_right"]
}
}
uic_r_a()
</script>
<script async data-cfasync="false" src="https://cdn.snigelweb.com/adengine/w3schools.com/loader.js" type="text/javascript"></script>
<script src="/lib/common-deps.js?v=1.0.0"></script>
<script src="/lib/user-session.js?v=1.0.2"></script>
<script src="/lib/my-learning.js?v=1.0.11"></script>
<script type='text/javascript'>
var stickyadstatus = "";
function fix_stickyad() {
document.getElementById("stickypos").style.position = "sticky";
var elem = document.getElementById("stickyadcontainer");
if (!elem) {return false;}
if (document.getElementById("skyscraper")) {
var skyWidth = Number(w3_getStyleValue(document.getElementById("skyscraper"), "width").replace("px", ""));
}
else {
var skyWidth = Number(w3_getStyleValue(document.getElementById("right"), "width").replace("px", ""));
}
elem.style.width = skyWidth + "px";
if (window.innerWidth <= 992) {
elem.style.position = "";
elem.style.top = stickypos + "px";
return false;
}
var stickypos = document.getElementById("stickypos").offsetTop;
var docTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
var adHeight = Number(w3_getStyleValue(elem, "height").replace("px", ""));
if (stickyadstatus == "") {
if ((stickypos - docTop) < 60) {
elem.style.position = "fixed";
elem.style.top = "60px";
stickyadstatus = "sticky";
document.getElementById("stickypos").style.position = "sticky";
}
} else {
if ((docTop + 60) - stickypos < 0) {
elem.style.position = "";
elem.style.top = stickypos + "px";
stickyadstatus = "";
document.getElementById("stickypos").style.position = "static";
}
}
if (stickyadstatus == "sticky") {
if ((docTop + adHeight + 60) > document.getElementById("footer").offsetTop) {
elem.style.position = "absolute";
elem.style.top = (document.getElementById("footer").offsetTop - adHeight) + "px";
document.getElementById("stickypos").style.position = "static";
} else {
elem.style.position = "fixed";
elem.style.top = "60px";
stickyadstatus = "sticky";
document.getElementById("stickypos").style.position = "sticky";
}
}
}
function w3_getStyleValue(elmnt,style) {
if (window.getComputedStyle) {
return window.getComputedStyle(elmnt,null).getPropertyValue(style);
} else {
return elmnt.currentStyle[style];
}
}
</script>
</head><body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KTCFC3S"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<style>
#darkmodemenu {
position:absolute;
top:-40px;
right:16px;
padding:5px 20px 10px 18px;
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
z-index:-1;
transition: top 0.2s;
user-select: none;
}
#darkmodemenu input,#darkmodemenu label {
cursor:pointer;
}
</style>
<script>
(
function setThemeMode() {
var x = localStorage.getItem("preferredmode");
var y = localStorage.getItem("preferredpagemode");
if (x == "dark") {
document.body.className += " darktheme";
}
if (y == "dark") {
document.body.className += " darkpagetheme";
}
})();
</script>
<div id="pagetop" class="w3-bar w3-card-2 notranslate">
<a href="https://www.w3schools.com" class="w3-bar-item w3-button w3-hover-none w3-left w3-padding-16" title="Home" style="width:77px">
<i class="fa fa-logo ws-text-green ws-hover-text-green" style="position:relative;font-size:42px!important;"></i>
</a>
<style>
.topnavmain_pro {
background-color:#282A35;
color:#fff;
}
body.darkpagetheme .topnavmain_pro {
background-color:#fff;
color:#000;
}
@media screen and (max-width: 1160px) {
.ws-hide-1160 {
display: none !important;
}
}
</style>
<a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open_nav('tutorials')" id="navbtn_tutorials" title="Tutorials" style="width:116px">Tutorials <i class='fa fa-caret-down' style="font-size:20px;"></i><i class='fa fa-caret-up' style="display:none"></i></a>
<a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open_nav('references')" id="navbtn_references" title="References" style="width:132px">References <i class='fa fa-caret-down' style="font-size:20px;"></i><i class='fa fa-caret-up' style="display:none"></i></a>
<a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24 ws-hide-800" href="javascript:void(0)" onclick="w3_open_nav('exercises')" id="navbtn_exercises" title="Exercises" style="width:118px">Exercises <i class='fa fa-caret-down' style="font-size:20px;"></i><i class='fa fa-caret-up' style="display:none"></i></a>
<a class="w3-bar-item w3-button w3-hide-medium bar-item-hover w3-hide-small w3-padding-24 barex topnavmain_video" href="https://www.w3schools.com/videos/index.php" title="Video Tutorials">Videos</a>
<!--<a class="w3-bar-item w3-button w3-hide-medium bar-item-hover w3-hide-small w3-padding-24 barex" href="/pro/index.php" title="Go Pro">Pro <span class="ribbon-topnav ws-hide-1080">NEW</span></a>-->
<a class="w3-bar-item w3-button bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open()" id="navbtn_menu" title="Menu" style="width:93px">Menu <i class='fa fa-caret-down'></i><i class='fa fa-caret-up' style="display:none"></i></a>
<div id="loginactioncontainer" class="w3-right w3-padding-16" style="margin-left:50px">
<div id="mypagediv"></div>
<!-- <button id="w3loginbtn" style="border:none;display:none;cursor:pointer" class="login w3-right w3-hover-greener" onclick='w3_open_nav("login")'>LOG IN</button>-->
<a id="w3loginbtn" class="w3-bar-item w3-btn bar-item-hover w3-right" style="display:none;width:130px;background-color:#04AA6D;color:white;border-radius:25px;" href="https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fmy-learning.w3schools.com" target="_self">Log in</a>
</div>
<div class="w3-right w3-padding-16">
<!--<a class="w3-bar-item w3-button bar-icon-hover w3-right w3-hover-white w3-hide-large w3-hide-medium" href="javascript:void(0)" onclick="w3_open()" title="Menu"><i class='fa'></i></a>
-->
<!--<a class="w3-bar-item w3-button bar-item-hover w3-right w3-hide-small barex" style="width: 140px; border-radius: 25px; margin-right: 15px;" href="https://shop.w3schools.com/collections/course-catalog" target="_blank" id="cert_navbtn" title="Courses">Paid Courses</a>-->
<a class="w3-bar-item w3-button w3-right ws-hide-900 w3-hide-small barex ws-yellow ws-hover-yellow gt-btn-top-spaces" style="width: 150px;border-radius: 25px; margin-right: 15px;" href="https://www.w3schools.com/spaces" target="_blank" title="Get Your Own Website With W3Schools Spaces">Free Website</a>
<a class="w3-bar-item w3-button w3-right ws-hide-1066 w3-hide-small barex ws-pink ws-hover-pink gt-btn-top-cert" style="border-radius: 25px; margin-right: 15px;" href="https://shop.w3schools.com/collections/course-catalog" target="_blank" id="cert_navbtn" title="Courses">Get Certified</a>
<a class="w3-bar-item w3-button w3-right w3-hover-dark-grey ws-hide-900 w3-hide-small ws-hide-1160 barex topnavmain_pro gt-btn-top-pro" style="border-radius: 25px; margin-right: 15px;" href="/pro/index.php" target="_blank" title="Go pro and unlock powerful features">Pro</a>
</div>
</div>
<div style='display:none;position:absolute;z-index:4;right:52px;height:44px;background-color:#282A35;letter-spacing:normal;' id='googleSearch'>
<div class='gcse-search'></div>
</div>
<div style='display:none;position:absolute;z-index:3;right:111px;height:44px;background-color:#282A35;text-align:right;padding-top:9px;' id='google_translate_element'></div>
<div class='w3-card-2 topnav notranslate' id='topnav'>
<div style="overflow:auto;">
<div class="w3-bar w3-left" style="width:100%;overflow:hidden;height:44px">
<a href='javascript:void(0);' class='topnav-icons fa fa-menu w3-hide-large w3-left w3-bar-item w3-button' onclick='open_menu()' title='Menu'></a>
<a href='/default.asp' class='topnav-icons fa fa-home w3-left w3-bar-item w3-button' title='Home'></a>
<a class="w3-bar-item w3-button" href='/html/default.asp' title='HTML Tutorial' style="padding-left:18px!important;padding-right:18px!important;">HTML</a>
<a class="w3-bar-item w3-button" href='/css/default.asp' title='CSS Tutorial'>CSS</a>
<a class="w3-bar-item w3-button" href='/js/default.asp' title='JavaScript Tutorial'>JAVASCRIPT</a>
<a class="w3-bar-item w3-button" href='/sql/default.asp' title='SQL Tutorial'>SQL</a>
<a class="w3-bar-item w3-button" href='/python/default.asp' title='Python Tutorial'>PYTHON</a>
<a class="w3-bar-item w3-button" href='/java/default.asp' title='Java Tutorial'>JAVA</a>
<a class="w3-bar-item w3-button" href='/php/default.asp' title='PHP Tutorial'>PHP</a>
<a class="w3-bar-item w3-button" href='/bootstrap/bootstrap_ver.asp' title='Bootstrap Tutorial'>BOOTSTRAP</a>
<a class="w3-bar-item w3-button" href='/howto/default.asp' title='How To'>HOW TO</a>
<a class="w3-bar-item w3-button" href='/w3css/default.asp' title='W3.CSS Tutorial'>W3.CSS</a>
<a class="w3-bar-item w3-button" href='/c/index.php' title='C Tutorial'>C</a>
<a class="w3-bar-item w3-button" href='/cpp/default.asp' title='C++ Tutorial'>C++</a>
<a class="w3-bar-item w3-button" href='/cs/index.php' title='C# Tutorial'>C#</a>
<a class="w3-bar-item w3-button" href='/react/default.asp' title='React Tutorial'>REACT</a>
<a class="w3-bar-item w3-button" href='/r/default.asp' title='R Tutorial'>R</a>
<a class="w3-bar-item w3-button" href='/jquery/default.asp' title='jQuery Tutorial'>JQUERY</a>
<a class="w3-bar-item w3-button" href='/django/index.php' title='Django Tutorial'>DJANGO</a>
<a class="w3-bar-item w3-button" href='/typescript/index.php' title='Typescript Tutorial'>TYPESCRIPT</a>
<a class="w3-bar-item w3-button" href='/nodejs/default.asp' title='NodeJS Tutorial'>NODEJS</a>
<a class="w3-bar-item w3-button" href='/mysql/default.asp' title='MySQL Tutorial'>MYSQL</a>
<a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='gSearch(this)' title='Search W3Schools'></a>
<a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='gTra(this)' title='Translate W3Schools'></a>
<!-- <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='changecodetheme(this)' title='Toggle Dark Code Examples'></a>-->
<a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkicon()" onclick='changepagetheme(2)'></a>
<!--
<a class="w3-bar-item w3-button w3-right" id='topnavbtn_exercises' href='javascript:void(0);' onclick='w3_open_nav("exercises")' title='Exercises'>EXERCISES <i class='fa fa-caret-down'></i><i class='fa fa-caret-up' style='display:none'></i></a>
-->
</div>
<div id="darkmodemenu" class="ws-black" onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkicon()">
<input id="radio_darkpage" type="checkbox" name="radio_theme_mode" onclick="click_darkpage()"><label for="radio_darkpage"> Dark mode</label>
<br>
<input id="radio_darkcode" type="checkbox" name="radio_theme_mode" onclick="click_darkcode()"><label for="radio_darkcode"> Dark code</label>
</div>
<nav id="nav_tutorials" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
<div class="w3-content" style="max-width:1100px;font-size:18px">
<span onclick="w3_close_nav('tutorials')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br>
<div class="w3-row-padding w3-bar-block">
<div class="w3-container" style="padding-left:13px">
<h2 style="color:#FFF4A3;"><b>Tutorials</b></h2>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">HTML and CSS</h3>
<a class="w3-bar-item w3-button" href="/html/default.asp">Learn HTML</a>
<a class="w3-bar-item w3-button" href="/css/default.asp">Learn CSS</a>
<a class="w3-bar-item w3-button" href="/css/css_rwd_intro.asp" title="Responsive Web Design">Learn RWD</a>
<a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_ver.asp">Learn Bootstrap</a>
<a class="w3-bar-item w3-button" href="/w3css/default.asp">Learn W3.CSS</a>
<a class="w3-bar-item w3-button" href="/colors/default.asp">Learn Colors</a>
<a class="w3-bar-item w3-button" href="/icons/default.asp">Learn Icons</a>
<a class="w3-bar-item w3-button" href="/graphics/default.asp">Learn Graphics</a>
<a class="w3-bar-item w3-button" href='/graphics/svg_intro.asp'>Learn SVG</a>
<a class="w3-bar-item w3-button" href='/graphics/canvas_intro.asp'>Learn Canvas</a>
<a class="w3-bar-item w3-button" href="/howto/default.asp">Learn How To</a>
<a class="w3-bar-item w3-button" href="/sass/default.php">Learn Sass</a>
<div class="w3-hide-large w3-hide-small">
<h3 class="w3-margin-top">Data Analytics</h3>
<a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a>
<a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a>
<a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a>
<a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a>
<a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a>
<a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a>
<a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a>
<a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a>
<a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a>
<h3 class="w3-margin-top">XML Tutorials</h3>
<a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a>
<a class="w3-bar-item w3-button" href='/xml/ajax_intro.asp'>Learn XML AJAX</a>
<a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a>
<a class="w3-bar-item w3-button" href='/xml/xml_dtd_intro.asp'>Learn XML DTD</a>
<a class="w3-bar-item w3-button" href='/xml/schema_intro.asp'>Learn XML Schema</a>
<a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a>
<a class="w3-bar-item w3-button" href='/xml/xpath_intro.asp'>Learn XPath</a>
<a class="w3-bar-item w3-button" href='/xml/xquery_intro.asp'>Learn XQuery</a>
</div>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">JavaScript</h3>
<a class="w3-bar-item w3-button" href="/js/default.asp">Learn JavaScript</a>
<a class="w3-bar-item w3-button" href="/jquery/default.asp">Learn jQuery</a>
<a class="w3-bar-item w3-button" href="/react/default.asp">Learn React</a>
<a class="w3-bar-item w3-button" href="/angular/default.asp">Learn AngularJS</a>
<a class="w3-bar-item w3-button" href="/js/js_json_intro.asp">Learn JSON</a>
<a class="w3-bar-item w3-button" href="/js/js_ajax_intro.asp">Learn AJAX</a>
<a class="w3-bar-item w3-button" href="/appml/default.asp">Learn AppML</a>
<a class="w3-bar-item w3-button" href="/w3js/default.asp">Learn W3.JS</a>
<h3 class="w3-margin-top">Programming</h3>
<a class="w3-bar-item w3-button" href="/python/default.asp">Learn Python</a>
<a class="w3-bar-item w3-button" href="/java/default.asp">Learn Java</a>
<a class="w3-bar-item w3-button" href="/c/index.php">Learn C</a>
<a class="w3-bar-item w3-button" href="/cpp/default.asp">Learn C++</a>
<a class="w3-bar-item w3-button" href="/cs/index.php">Learn C#</a>
<a class="w3-bar-item w3-button" href="/r/default.asp">Learn R</a>
<a class="w3-bar-item w3-button" href="/kotlin/index.php">Learn Kotlin</a>
<a class="w3-bar-item w3-button" href="/go/index.php">Learn Go</a>
<a class="w3-bar-item w3-button" href="/django/index.php">Learn Django</a>
<a class="w3-bar-item w3-button" href="/typescript/index.php">Learn TypeScript</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">Server Side</h3>
<a class="w3-bar-item w3-button" href="/sql/default.asp">Learn SQL</a>
<a class="w3-bar-item w3-button" href="/mysql/default.asp">Learn MySQL</a>
<a class="w3-bar-item w3-button" href="/php/default.asp">Learn PHP</a>
<a class="w3-bar-item w3-button" href='/asp/default.asp'>Learn ASP</a>
<a class="w3-bar-item w3-button" href='/nodejs/default.asp'>Learn Node.js</a>
<a class="w3-bar-item w3-button" href='/nodejs/nodejs_raspberrypi.asp'>Learn Raspberry Pi</a>
<a class="w3-bar-item w3-button" href='/git/default.asp'>Learn Git</a>
<a class="w3-bar-item w3-button" href='/mongodb/index.php'>Learn MongoDB</a>
<a class="w3-bar-item w3-button" href='/aws/index.php'>Learn AWS Cloud</a>
<h3 class="w3-margin-top">Web Building</h3>
<a class="w3-bar-item w3-button" href="https://www.w3schools.com/spaces" target="_blank" title="Get Your Own Website With W3schools Spaces">Create a Website <span class="ribbon-topnav ws-yellow">NEW</span></a>
<a class="w3-bar-item w3-button" href="/where_to_start.asp">Where To Start</a>
<a class="w3-bar-item w3-button" href="/w3css/w3css_templates.asp">Web Templates</a>
<a class="w3-bar-item w3-button" href="/browsers/default.asp">Web Statistics</a>
<a class="w3-bar-item w3-button" href="/cert/default.asp">Web Certificates</a>
<a class="w3-bar-item w3-button" href="/whatis/default.asp">Web Development</a>
<a class="w3-bar-item w3-button" href='/tryit/default.asp'>Code Editor</a>
<a class="w3-bar-item w3-button" href="/typingspeed/default.asp">Test Your Typing Speed</a>
<a class="w3-bar-item w3-button" href="/codegame/index.html" target="_blank">Play a Code Game</a>
<a class="w3-bar-item w3-button" href="/cybersecurity/index.php">Cyber Security</a>
<a class="w3-bar-item w3-button" href="/accessibility/index.php">Accessibility</a>
</div>
<div class="w3-col l3 m6 w3-hide-medium">
<h3 class="w3-margin-top">Data Analytics</h3>
<a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a>
<a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a>
<a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a>
<a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a>
<a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a>
<a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a>
<a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a>
<a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a>
<a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a>
<a class="w3-bar-item w3-button" href="/googlesheets/index.php">Learn Google Sheets</a>
<h3 class="w3-margin-top">XML Tutorials</h3>
<a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a>
<a class="w3-bar-item w3-button" href='/xml/ajax_intro.asp'>Learn XML AJAX</a>
<a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a>
<a class="w3-bar-item w3-button" href='/xml/xml_dtd_intro.asp'>Learn XML DTD</a>
<a class="w3-bar-item w3-button" href='/xml/schema_intro.asp'>Learn XML Schema</a>
<a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a>
<a class="w3-bar-item w3-button" href='/xml/xpath_intro.asp'>Learn XPath</a>
<a class="w3-bar-item w3-button" href='/xml/xquery_intro.asp'>Learn XQuery</a>
</div>
</div>
</div>
<br class="hidesm">
</nav>
<nav id="nav_references" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
<div class="w3-content" style="max-width:1100px;font-size:18px">
<span onclick="w3_close_nav('references')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br>
<div class="w3-row-padding w3-bar-block">
<div class="w3-container" style="padding-left:13px">
<h2 style="color:#FFF4A3;"><b>References</b></h2>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">HTML</h3>
<a class="w3-bar-item w3-button" href='/tags/default.asp'>HTML Tag Reference</a>
<a class="w3-bar-item w3-button" href='/tags/ref_html_browsersupport.asp'>HTML Browser Support</a>
<a class="w3-bar-item w3-button" href='/tags/ref_eventattributes.asp'>HTML Event Reference</a>
<a class="w3-bar-item w3-button" href='/colors/default.asp'>HTML Color Reference</a>
<a class="w3-bar-item w3-button" href='/tags/ref_attributes.asp'>HTML Attribute Reference</a>
<a class="w3-bar-item w3-button" href='/tags/ref_canvas.asp'>HTML Canvas Reference</a>
<a class="w3-bar-item w3-button" href='/graphics/svg_reference.asp'>HTML SVG Reference</a>
<a class="w3-bar-item w3-button" href='/graphics/google_maps_reference.asp'>Google Maps Reference</a>
<h3 class="w3-margin-top">CSS</h3>
<a class="w3-bar-item w3-button" href='/cssref/default.asp'>CSS Reference</a>
<a class="w3-bar-item w3-button" href='/cssref/css3_browsersupport.asp'>CSS Browser Support</a>
<a class="w3-bar-item w3-button" href='/cssref/css_selectors.asp'>CSS Selector Reference</a>
<a class="w3-bar-item w3-button" href='/bootstrap/bootstrap_ref_all_classes.asp'>Bootstrap 3 Reference</a>
<a class="w3-bar-item w3-button" href='/bootstrap4/bootstrap_ref_all_classes.asp'>Bootstrap 4 Reference</a>
<a class="w3-bar-item w3-button" href='/w3css/w3css_references.asp'>W3.CSS Reference</a>
<a class="w3-bar-item w3-button" href='/icons/icons_reference.asp'>Icon Reference</a>
<a class="w3-bar-item w3-button" href='/sass/sass_functions_string.php'>Sass Reference</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">JavaScript</h3>
<a class="w3-bar-item w3-button" href='/jsref/default.asp'>JavaScript Reference</a>
<a class="w3-bar-item w3-button" href='/jsref/default.asp'>HTML DOM Reference</a>
<a class="w3-bar-item w3-button" href='/jquery/jquery_ref_overview.asp'>jQuery Reference</a>
<a class="w3-bar-item w3-button" href='/angular/angular_ref_directives.asp'>AngularJS Reference</a>
<a class="w3-bar-item w3-button" href="/appml/appml_reference.asp">AppML Reference</a>
<a class="w3-bar-item w3-button" href="/w3js/w3js_references.asp">W3.JS Reference</a>
<h3 class="w3-margin-top">Programming</h3>
<a class="w3-bar-item w3-button" href='/python/python_reference.asp'>Python Reference</a>
<a class="w3-bar-item w3-button" href='/java/java_ref_keywords.asp'>Java Reference</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">Server Side</h3>
<a class="w3-bar-item w3-button" href='/sql/sql_ref_keywords.asp'>SQL Reference</a>
<a class="w3-bar-item w3-button" href='/mysql/mysql_ref_functions.asp'>MySQL Reference</a>
<a class="w3-bar-item w3-button" href='/php/php_ref_overview.asp'>PHP Reference</a>
<a class="w3-bar-item w3-button" href='/asp/asp_ref_response.asp'>ASP Reference</a>
<h3 class="w3-margin-top">XML</h3>
<a class="w3-bar-item w3-button" href='/xml/dom_nodetype.asp'>XML DOM Reference</a>
<a class="w3-bar-item w3-button" href='/xml/dom_http.asp'>XML Http Reference</a>
<a class="w3-bar-item w3-button" href='/xml/xsl_elementref.asp'>XSLT Reference</a>
<a class="w3-bar-item w3-button" href='/xml/schema_elements_ref.asp'>XML Schema Reference</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top">Character Sets</h3>
<a class="w3-bar-item w3-button" href='/charsets/default.asp'>HTML Character Sets</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_ascii.asp'>HTML ASCII</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_ansi.asp'>HTML ANSI</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_ansi.asp'>HTML Windows-1252</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_8859.asp'>HTML ISO-8859-1</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_symbols.asp'>HTML Symbols</a>
<a class="w3-bar-item w3-button" href='/charsets/ref_html_utf8.asp'>HTML UTF-8</a>
</div>
</div>
<br class="hidesm">
</div>
</nav>
<nav id="nav_exercises" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
<div class="w3-content" style="max-width:1100px;font-size:18px">
<span onclick="w3_close_nav('exercises')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br>
<div class="w3-row-padding w3-bar-block">
<div class="w3-container" style="padding-left:13px">
<h2 style="color:#FFF4A3;"><b>Exercises and Quizzes</b></h2>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:155px;font-size:21px" href="/exercises/index.php">Exercises</a></h3>
<a class="w3-bar-item w3-button" href="/html/html_exercises.asp">HTML Exercises</a>
<a class="w3-bar-item w3-button" href="/css/css_exercises.asp">CSS Exercises</a>
<a class="w3-bar-item w3-button" href="/js/js_exercises.asp">JavaScript Exercises</a>
<a class="w3-bar-item w3-button" href="/python/python_exercises.asp">Python Exercises</a>
<a class="w3-bar-item w3-button" href="/sql/sql_exercises.asp">SQL Exercises</a>
<a class="w3-bar-item w3-button" href="/php/php_exercises.asp">PHP Exercises</a>
<a class="w3-bar-item w3-button" href="/java/java_exercises.asp">Java Exercises</a>
<a class="w3-bar-item w3-button" href="/c/c_exercises.php">C Exercises</a>
<a class="w3-bar-item w3-button" href="/cpp/cpp_exercises.asp">C++ Exercises</a>
<a class="w3-bar-item w3-button" href="/cs/cs_exercises.asp">C# Exercises</a>
<a class="w3-bar-item w3-button" href="/jquery/jquery_exercises.asp">jQuery Exercises</a>
<a class="w3-bar-item w3-button" href="/react/react_exercises.asp">React.js Exercises</a>
<a class="w3-bar-item w3-button" href="/mysql/mysql_exercises.asp">MySQL Exercises</a>
<a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_exercises.php">Bootstrap 5 Exercises</a>
<a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_exercises.asp">Bootstrap 4 Exercises</a>
<a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_exercises.asp">Bootstrap 3 Exercises</a>
<a class="w3-bar-item w3-button" href="/python/numpy/numpy_exercises.asp">NumPy Exercises</a>
<a class="w3-bar-item w3-button" href="/python/pandas/pandas_exercises.asp">Pandas Exercises</a>
<a class="w3-bar-item w3-button" href="/python/scipy/scipy_exercises.php">SciPy Exercises</a>
<a class="w3-bar-item w3-button" href="/typescript/typescript_exercises.php">TypeScript Exercises</a>
<a class="w3-bar-item w3-button" href="/excel/excel_exercises.php">Excel Exercises</a>
<a class="w3-bar-item w3-button" href="/r/r_exercises.asp">R Exercises</a>
<a class="w3-bar-item w3-button" href="/git/git_exercises.asp">Git Exercises</a>
<a class="w3-bar-item w3-button" href="/kotlin/kotlin_exercises.php">Kotlin Exercises</a>
<a class="w3-bar-item w3-button" href="/go/go_exercises.php">Go Exercises</a>
<a class="w3-bar-item w3-button" href="/mongodb/mongodb_exercises.php">MongoDB Exercises</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:135px;font-size:21px" href="/quiztest/default.asp">Quizzes</a></h3>
<a class="w3-bar-item w3-button" href="/html/html_quiz.asp" target="_top">HTML Quiz</a>
<a class="w3-bar-item w3-button" href="/css/css_quiz.asp" target="_top">CSS Quiz</a>
<a class="w3-bar-item w3-button" href="/js/js_quiz.asp" target="_top">JavaScript Quiz</a>
<a class="w3-bar-item w3-button" href="/python/python_quiz.asp" target="_top">Python Quiz</a>
<a class="w3-bar-item w3-button" href="/sql/sql_quiz.asp" target="_top">SQL Quiz</a>
<a class="w3-bar-item w3-button" href="/php/php_quiz.asp" target="_top">PHP Quiz</a>
<a class="w3-bar-item w3-button" href="/java/java_quiz.asp" target="_top">Java Quiz</a>
<a class="w3-bar-item w3-button" href="/c/c_quiz.php">C Quiz</a>
<a class="w3-bar-item w3-button" href="/cpp/cpp_quiz.asp" target="_top">C++ Quiz</a>
<a class="w3-bar-item w3-button" href="/cs/cs_quiz.asp" target="_top">C# Quiz</a>
<a class="w3-bar-item w3-button" href="/jquery/jquery_quiz.asp" target="_top">jQuery Quiz</a>
<a class="w3-bar-item w3-button" href="/react/react_quiz.asp">React.js Quiz</a>
<a class="w3-bar-item w3-button" href="/mysql/mysql_quiz.asp" target="_top">MySQL Quiz</a>
<a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_quiz.php" target="_top">Bootstrap 5 Quiz</a>
<a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_quiz.asp" target="_top">Bootstrap 4 Quiz</a>
<a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_quiz.asp" target="_top">Bootstrap 3 Quiz</a>
<a class="w3-bar-item w3-button" href="/python/numpy/numpy_quiz.asp" target="_top">NumPy Quiz</a>
<a class="w3-bar-item w3-button" href="/python/pandas/pandas_quiz.asp" target="_top">Pandas Quiz</a>
<a class="w3-bar-item w3-button" href="/python/scipy/scipy_quiz.php" target="_top">SciPy Quiz</a>
<a class="w3-bar-item w3-button" href="/typescript/typescript_quiz.php">TypeScript Quiz</a>
<a class="w3-bar-item w3-button" href="/xml/xml_quiz.asp" target="_top">XML Quiz</a>
<a class="w3-bar-item w3-button" href="/r/r_quiz.asp" target="_top">R Quiz</a>
<a class="w3-bar-item w3-button" href="/git/git_quiz.asp">Git Quiz</a>
<a class="w3-bar-item w3-button" href="/kotlin/kotlin_quiz.php" target="_top">Kotlin Quiz</a>
<a class="w3-bar-item w3-button" href="/cybersecurity/cybersecurity_quiz.php">Cyber Security Quiz</a>
<a class="w3-bar-item w3-button" href="/accessibility/accessibility_quiz.php">Accessibility Quiz</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:135px;font-size:21px" href="https://campus.w3schools.com/collections/course-catalog" target="_blank">Courses</a></h3>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/html-course" target="_blank">HTML Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/css-course" target="_blank">CSS Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/javascript-course" target="_blank">JavaScript Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/front-end-course" target="_blank">Front End Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/python-course" target="_blank">Python Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/sql-course" target="_blank">SQL Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/php-course" target="_blank">PHP Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/java-course" target="_blank">Java Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/c-course-1" target="_blank">C++ Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/c-course" target="_blank">C# Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/jquery-course" target="_blank">jQuery Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/react-js-course" target="_blank">React.js Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/bootstrap-4-course" target="_blank">Bootstrap 4 Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/bootstrap-course" target="_blank">Bootstrap 3 Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/numpy-course" target="_blank">NumPy Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/pandas-course" target="_blank">Pandas Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/learn-typescript" target="_blank">TypeScript Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/xml-course" target="_blank">XML Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/r-course" target="_blank">R Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/data-analytics-program" target="_blank">Data Analytics Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/cyber-security-course" target="_blank">Cyber Security Course</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/accessibility-course" target="_blank">Accessibility Course</a>
</div>
<div class="w3-col l3 m6">
<h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:150px;font-size:21px" href="https://campus.w3schools.com/collections/certifications" target="_blank">Certificates</a></h3>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/html-certificate" target="_blank">HTML Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/css-certificate" target="_blank">CSS Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/javascript-certificate" target="_blank">JavaScript Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/front-end-certificate" target="_blank">Front End Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/python-certificate" target="_blank">Python Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/sql-certificate" target="_blank">SQL Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/php-certificate" target="_blank">PHP Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/java-certificate" target="_blank">Java Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/c-certificate" target="_blank">C++ Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/c-certificate-1" target="_blank">C# Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/jquery-certificate" target="_blank">jQuery Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/react-js-certificate" target="_blank">React.js Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/mysql-certificate" target="_blank">MySQL Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-5-certificate" target="_blank">Bootstrap 5 Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-4-certificate" target="_blank">Bootstrap 4 Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-3-certificate" target="_blank">Bootstrap 3 Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/typescript-certificate" target="_blank">TypeScript Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/xml-certificate" target="_blank">XML Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/excel-certificate" target="_blank">Excel Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/data-science-certificate" target="_blank">Data Science Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/cyber-security-certificate" target="_blank">Cyber Security Certificate</a>
<a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/accessibility-certificate" target="_blank">Accessibility Certificate</a>
</div>
</div>
<br class="hidesm">
</div>
</nav>
</div>
</div>
<div id='myAccordion' class="w3-card-2 w3-center w3-hide-large w3-hide-medium ws-grey" style="width:100%;position:absolute;display:none;">
<a href="javascript:void(0)" onclick="w3_close()" class="w3-button w3-xxlarge w3-right">×</a><br>
<div class="w3-container w3-padding-32">
<a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('tutorials');" href="javascript:void(0);">Tutorials <i class='fa fa-caret-down'></i></a>
<div id="sectionxs_tutorials" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
<a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('references')" href="javascript:void(0);">References <i class='fa fa-caret-down'></i></a>
<div id="sectionxs_references" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
<a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('exercises')" href="javascript:void(0);">Exercises <i class='fa fa-caret-down'></i></a>
<div id="sectionxs_exercises" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
<a class="w3-button w3-block" style="font-size:22px;" href="https://campus.w3schools.com/collections/course-catalog" target="_blank">Get Certified</a>
<a class="w3-button w3-block" style="font-size:22px;" href="https://www.w3schools.com/spaces" target="_blank" title="Get Your Own Website With W3schools Spaces">Spaces</a>
<a class="w3-button w3-block" style="font-size:22px;" target="_blank"href="https://www.w3schools.com/videos/index.php" title="Video Tutorials">Videos</a>
<a class="w3-button w3-block" style="font-size:22px;" href="https://shop.w3schools.com" target="_blank">Shop</a>
<a class="w3-button w3-block" style="font-size:22px;" href="/pro/index.php">Pro</a>
</div>
</div>
<script>
(
function setThemeCheckboxes() {
var x = localStorage.getItem("preferredmode");
var y = localStorage.getItem("preferredpagemode");
if (x == "dark") {
document.getElementById("radio_darkcode").checked = true;
}
if (y == "dark") {
document.getElementById("radio_darkpage").checked = true;
}
})();
function mouseoverdarkicon() {
if(window.matchMedia("(pointer: coarse)").matches) {
return false;
}
var a = document.getElementById("darkmodemenu");
a.style.top = "44px";
}
function mouseoutofdarkicon() {
var a = document.getElementById("darkmodemenu");
a.style.top = "-40px";
}
function changepagetheme(n) {
var a = document.getElementById("radio_darkcode");
var b = document.getElementById("radio_darkpage");
document.body.className = document.body.className.replace("darktheme", "");
document.body.className = document.body.className.replace("darkpagetheme", "");
document.body.className = document.body.className.replace(" ", " ");
if (a.checked && b.checked) {
localStorage.setItem("preferredmode", "light");
localStorage.setItem("preferredpagemode", "light");
a.checked = false;
b.checked = false;
} else {
document.body.className += " darktheme";
document.body.className += " darkpagetheme";
localStorage.setItem("preferredmode", "dark");
localStorage.setItem("preferredpagemode", "dark");
a.checked = true;
b.checked = true;
}
}
function click_darkpage() {
var b = document.getElementById("radio_darkpage");
if (b.checked) {
document.body.className += " darkpagetheme";
document.body.className = document.body.className.replace(" ", " ");
localStorage.setItem("preferredpagemode", "dark");
} else {
document.body.className = document.body.className.replace("darkpagetheme", "");
document.body.className = document.body.className.replace(" ", " ");
localStorage.setItem("preferredpagemode", "light");
}
}
function click_darkcode() {
var a = document.getElementById("radio_darkcode");
if (a.checked) {
document.body.className += " darktheme";
document.body.className = document.body.className.replace(" ", " ");
localStorage.setItem("preferredmode", "dark");
} else {
document.body.className = document.body.className.replace("darktheme", "");
document.body.className = document.body.className.replace(" ", " ");
localStorage.setItem("preferredmode", "light");
}
}
</script>
<div class='w3-sidebar w3-collapse' id='sidenav'>
<div id='leftmenuinner'>
<div id='leftmenuinnerinner'>
<!-- <a href='javascript:void(0)' onclick='close_menu()' class='w3-button w3-hide-large w3-large w3-display-topright' style='right:16px;padding:3px 12px;font-weight:bold;'>×</a>-->
<h2 class="left">JS Tutorial</h2>
<a target="_top" href="default.asp">JS HOME</a>
<a target="_top" href="js_intro.asp">JS Introduction</a>
<a target="_top" href="js_whereto.asp">JS Where To</a>
<a target="_top" href="js_output.asp">JS Output</a>
<a target="_top" href="js_statements.asp">JS Statements</a>
<a target="_top" href="js_syntax.asp">JS Syntax</a>
<a target="_top" href="js_comments.asp">JS Comments</a>
<a target="_top" href="js_variables.asp">JS Variables</a>
<a target="_top" href="js_let.asp">JS Let</a>
<a target="_top" href="js_const.asp">JS Const</a>
<a target="_top" href="js_operators.asp">JS Operators</a>
<a target="_top" href="js_arithmetic.asp">JS Arithmetic</a>
<a target="_top" href="js_assignment.asp">JS Assignment</a>
<a target="_top" href="js_precedence.asp">JS Precedence</a>
<a target="_top" href="js_datatypes.asp">JS Data Types</a>
<a target="_top" href="js_functions.asp">JS Functions</a>
<a target="_top" href="js_objects.asp">JS Objects</a>
<a target="_top" href="js_events.asp">JS Events</a>
<a target="_top" href="js_strings.asp">JS Strings</a>
<a target="_top" href="js_string_methods.asp">JS String Methods</a>
<a target="_top" href="js_string_search.asp">JS String Search</a>
<a target="_top" href="js_string_templates.asp">JS String Templates</a>
<a target="_top" href="js_numbers.asp">JS Numbers</a>
<a target="_top" href="js_number_methods.asp">JS Number Methods</a>
<a target="_top" href="js_arrays.asp">JS Arrays</a>
<a target="_top" href="js_array_methods.asp">JS Array Methods</a>
<a target="_top" href="js_array_sort.asp">JS Array Sort</a>
<a target="_top" href="js_array_iteration.asp">JS Array Iteration</a>
<a target="_top" href="js_array_const.asp">JS Array Const</a>
<a target="_top" href="js_dates.asp">JS Dates</a>
<a target="_top" href="js_date_formats.asp">JS Date Formats</a>
<a target="_top" href="js_date_methods.asp">JS Date Get Methods</a>
<a target="_top" href="js_date_methods_set.asp">JS Date Set Methods</a>
<a target="_top" href="js_math.asp">JS Math</a>
<a target="_top" href="js_random.asp">JS Random</a>
<a target="_top" href="js_booleans.asp">JS Booleans</a>
<a target="_top" href="js_comparisons.asp">JS Comparisons</a>
<a target="_top" href="js_if_else.asp">JS If Else</a>
<a target="_top" href="js_switch.asp">JS Switch</a>
<a target="_top" href="js_loop_for.asp">JS Loop For</a>
<a target="_top" href="js_loop_forin.asp">JS Loop For In</a>
<a target="_top" href="js_loop_forof.asp">JS Loop For Of</a>
<a target="_top" href="js_loop_while.asp">JS Loop While</a>
<a target="_top" href="js_break.asp">JS Break</a>
<a target="_top" href="js_iterables.asp">JS Iterables</a>
<a target="_top" href="js_sets.asp">JS Sets</a>
<a target="_top" href="js_maps.asp">JS Maps</a>
<a target="_top" href="js_typeof.asp">JS Typeof</a>
<a target="_top" href="js_type_conversion.asp">JS Type Conversion</a>
<a target="_top" href="js_bitwise.asp">JS Bitwise</a>
<a target="_top" href="js_regexp.asp">JS RegExp</a>
<a target="_top" href="js_errors.asp">JS Errors</a>
<a target="_top" href="js_scope.asp">JS Scope</a>
<a target="_top" href="js_hoisting.asp">JS Hoisting</a>
<a target="_top" href="js_strict.asp">JS Strict Mode</a>
<a target="_top" href="js_this.asp">JS this Keyword</a>
<a target="_top" href="js_arrow_function.asp">JS Arrow Function</a>
<a target="_top" href="js_classes.asp">JS Classes</a>
<a target="_top" href="js_modules.asp">JS Modules</a>
<a target="_top" href="js_json.asp">JS JSON</a>
<a target="_top" href="js_debugging.asp">JS Debugging</a>
<a target="_top" href="js_conventions.asp">JS Style Guide</a>
<a target="_top" href="js_best_practices.asp">JS Best Practices</a>
<a target="_top" href="js_mistakes.asp">JS Mistakes</a>
<a target="_top" href="js_performance.asp">JS Performance</a>
<a target="_top" href="js_reserved.asp">JS Reserved Words</a>
<br>
<h2 class="left">JS Versions</h2>
<a target="_top" href="js_versions.asp">JS Versions</a>
<a target="_top" href="js_es5.asp">JS 2009 (ES5)</a>
<a target="_top" href="js_es6.asp">JS 2015 (ES6)</a>
<a target="_top" href="js_2016.asp">JS 2016</a>
<a target="_top" href="js_2017.asp">JS 2017</a>
<a target="_top" href="js_2018.asp">JS 2018</a>
<a target="_top" href="js_2019.asp">JS 2019</a>
<a target="_top" href="js_2020.asp">JS 2020 / 2021</a>
<a target="_top" href="js_ie_edge.asp">JS IE / Edge</a>
<a target="_top" href="js_history.asp">JS History</a>
<br>
<h2 class="left">JS Objects</h2>
<a target="_top" href="js_object_definition.asp">Object Definitions</a>
<a target="_top" href="js_object_properties.asp">Object Properties</a>
<a target="_top" href="js_object_methods.asp">Object Methods</a>
<a target="_top" href="js_object_display.asp">Object Display</a>
<a target="_top" href="js_object_accessors.asp">Object Accessors</a>
<a target="_top" href="js_object_constructors.asp">Object Constructors</a>
<a target="_top" href="js_object_prototypes.asp">Object Prototypes</a>
<a target="_top" href="js_object_iterables.asp">Object Iterables</a>
<a target="_top" href="js_object_sets.asp">Object Sets</a>
<a target="_top" href="js_object_maps.asp">Object Maps</a>
<a target="_top" href="js_object_es5.asp">Object Reference</a>
<br>
<h2 class="left">JS Functions</h2>
<a target="_top" href="js_function_definition.asp">Function Definitions</a>
<a target="_top" href="js_function_parameters.asp">Function Parameters</a>
<a target="_top" href="js_function_invocation.asp">Function Invocation</a>
<a target="_top" href="js_function_call.asp">Function Call</a>
<a target="_top" href="js_function_apply.asp">Function Apply</a>
<a target="_top" href="js_function_bind.asp">Function Bind</a>
<a target="_top" href="js_function_closures.asp">Function Closures</a>
<br>
<h2 class="left">JS Classes</h2>
<a target="_top" href="js_class_intro.asp">Class Intro</a>
<a target="_top" href="js_class_inheritance.asp">Class Inheritance</a>
<a target="_top" href="js_class_static.asp">Class Static</a>
<br>
<h2 class="left">JS Async</h2>
<a target="_top" href="js_callback.asp">JS Callbacks</a>
<a target="_top" href="js_asynchronous.asp">JS Asynchronous</a>
<a target="_top" href="js_promise.asp">JS Promises</a>
<a target="_top" href="js_async.asp">JS Async/Await</a>
<br>
<h2 class="left">JS HTML DOM</h2>
<a target="_top" href="js_htmldom.asp">DOM Intro</a>
<a target="_top" href="js_htmldom_methods.asp">DOM Methods</a>
<a target="_top" href="js_htmldom_document.asp">DOM Document</a>
<a target="_top" href="js_htmldom_elements.asp">DOM Elements</a>
<a target="_top" href="js_htmldom_html.asp">DOM HTML</a>
<a target="_top" href="js_validation.asp">DOM Forms</a>
<a target="_top" href="js_htmldom_css.asp">DOM CSS</a>
<a target="_top" href="js_htmldom_animate.asp">DOM Animations</a>
<a target="_top" href="js_htmldom_events.asp">DOM Events</a>
<a target="_top" href="js_htmldom_eventlistener.asp">DOM Event Listener</a>
<a target="_top" href="js_htmldom_navigation.asp">DOM Navigation</a>
<a target="_top" href="js_htmldom_nodes.asp">DOM Nodes</a>
<a target="_top" href="js_htmldom_collections.asp">DOM Collections</a>
<a target="_top" href="js_htmldom_nodelist.asp">DOM Node Lists</a>
<br>
<h2 class="left">JS Browser BOM</h2>
<a target="_top" href="js_window.asp">JS Window</a>
<a target="_top" href="js_window_screen.asp">JS Screen</a>
<a target="_top" href="js_window_location.asp">JS Location</a>
<a target="_top" href="js_window_history.asp">JS History</a>
<a target="_top" href="js_window_navigator.asp">JS Navigator</a>
<a target="_top" href="js_popup.asp">JS Popup Alert</a>
<a target="_top" href="js_timing.asp">JS Timing</a>
<a target="_top" href="js_cookies.asp">JS Cookies</a>
<br>
<h2 class="left">JS Web APIs</h2>
<a target="_top" href="js_api_intro.asp">Web API Intro</a>
<a target="_top" href="js_validation_api.asp">Web Forms API</a>
<a target="_top" href="js_api_history.asp">Web History API</a>
<a target="_top" href="js_api_web_storage.asp">Web Storage API</a>
<a target="_top" href="js_api_web_workers.asp">Web Worker API</a>
<a target="_top" href="js_api_fetch.asp">Web Fetch API</a>
<a target="_top" href="js_api_geolocation.asp">Web Geolocation API</a>
<br>
<h2 class="left">JS AJAX</h2>
<a target="_top" href="js_ajax_intro.asp">AJAX Intro</a>
<a target="_top" href="js_ajax_http.asp">AJAX XMLHttp</a>
<a target="_top" href="js_ajax_http_send.asp">AJAX Request</a>
<a target="_top" href="js_ajax_http_response.asp">AJAX Response</a>
<a target="_top" href="js_ajax_xmlfile.asp">AJAX XML File</a>
<a target="_top" href="js_ajax_php.asp">AJAX PHP</a>
<a target="_top" href="js_ajax_asp.asp">AJAX ASP</a>
<a target="_top" href="js_ajax_database.asp">AJAX Database</a>
<a target="_top" href="js_ajax_applications.asp">AJAX Applications</a>
<a target="_top" href="js_ajax_examples.asp">AJAX Examples</a>
<br>
<h2 class="left">JS JSON</h2>
<a target="_top" href="js_json_intro.asp">JSON Intro</a>
<a target="_top" href="js_json_syntax.asp">JSON Syntax</a>
<a target="_top" href="js_json_xml.asp">JSON vs XML</a>
<a target="_top" href="js_json_datatypes.asp">JSON Data Types</a>
<a target="_top" href="js_json_parse.asp">JSON Parse</a>
<a target="_top" href="js_json_stringify.asp">JSON Stringify</a>
<a target="_top" href="js_json_objects.asp">JSON Objects</a>
<a target="_top" href="js_json_arrays.asp">JSON Arrays</a>
<a target="_top" href="js_json_server.asp">JSON Server</a>
<a target="_top" href="js_json_php.asp">JSON PHP</a>
<a target="_top" href="js_json_html.asp">JSON HTML</a>
<a target="_top" href="js_json_jsonp.asp">JSON JSONP</a>
<br>
<h2 class="left">JS vs jQuery</h2>
<a target="_top" href="js_jquery_selectors.asp">jQuery Selectors</a>
<a target="_top" href="js_jquery_elements.asp">jQuery HTML</a>
<a target="_top" href="js_jquery_css.asp">jQuery CSS</a>
<a target="_top" href="js_jquery_dom.asp">jQuery DOM</a>
<br>
<h2 class="left">JS Graphics</h2>
<a target="_top" href="js_graphics.asp">JS Graphics</a>
<a target="_top" href="js_graphics_canvas.asp">JS Canvas</a>
<a target="_top" href="js_graphics_plotly.asp">JS Plotly</a>
<a target="_top" href="js_graphics_chartjs.asp">JS Chart.js</a>
<a target="_top" href="js_graphics_google_chart.asp">JS Google Chart</a>
<a target="_top" href="js_graphics_d3js.asp">JS D3.js</a>
<br>
<h2 class="left">JS Examples</h2>
<a target="_top" href="js_examples.asp">JS Examples</a>
<a target="_top" href="js_dom_examples.asp">JS HTML DOM</a>
<a target="_top" href="js_input_examples.asp">JS HTML Input</a>
<a target="_top" href="js_ex_dom.asp">JS HTML Objects</a>
<a target="_top" href="js_events_examples.asp">JS HTML Events</a>
<a target="_top" href="js_ex_browser.asp">JS Browser</a>
<a target="_top" href="js_editor.asp">JS Editor</a>
<a target="_top" href="js_exercises.asp">JS Exercises</a>
<a target="_top" href="js_quiz.asp">JS Quiz</a>
<a target="_top" href="js_exam.asp">JS Certificate</a>
<br>
<h2 class="left">JS References</h2>
<a target="_top" href="/jsref/default.asp">JavaScript Objects</a>
<a target="_top" href="/jsref/default.asp">HTML DOM Objects</a>
<br>
<br><br>
</div>
</div>
</div>
<div class='w3-main w3-light-grey' id='belowtopnav' style='margin-left:220px;'>
<div class='w3-row w3-white'>
<div class='w3-col l10 m12' id='main'>
<div id='mainLeaderboard' style='overflow:hidden;'>
<!-- MainLeaderboard-->
<!--<pre>main_leaderboard, all: [728,90][970,90][320,50][468,60]</pre>-->
<div id="adngin-main_leaderboard-0"></div>
<!-- adspace leaderboard -->
</div>
<h1>JavaScript <span class="color_h1">Tutorial</span></h1>
<div class="w3-clear nextprev">
<a class="w3-left w3-btn" href="/default.asp">❮ Home</a>
<a class="w3-right w3-btn" href="js_intro.asp">Next ❯</a>
</div>
<div class="w3-panel w3-info intro">
<p>JavaScript is the world's most popular programming language.</p>
<p>JavaScript is the programming language of the Web.</p>
<p>JavaScript is easy to learn.</p>
<p>This tutorial will teach you JavaScript from basic to advanced.</p>
<a class="w3-btn w3-margin-bottom" href="js_intro.asp" style="font-size: 18px;padding-left:25px;padding-right:25px;font-family: 'Source Sans Pro', sans-serif;margin-top:6px;">Start learning JavaScript now »</a>
</div>
<h2>Examples in Each Chapter</h2>
<p>With our "Try it Yourself" editor, you can edit the source code and view
the result.</p>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-padding w3-white notranslate">
<h2>My First JavaScript</h2>
<button type="button" onclick="document.getElementById('demo').innerHTML=Date()">
Click me to display Date and Time</button>
<p id="demo"></p>
</div>
<p>
<a target="_blank" class="w3-btn" href="tryit.asp?filename=tryjs_myfirst">Try it Yourself »</a>
</p>
</div>
<hr>
<h2>Use the Menu</h2>
<p>We recommend reading this tutorial, in the sequence listed in the menu.</p>
<p>If you have a large screen, the menu will always be present on the left.</p>
<p>If you have a small screen, open the menu by clicking the top menu sign <span class="w3-xlarge">☰</span>.</p>
<hr>
<h2>Learn by Examples</h2>
<p>Examples are better than 1000 words. Examples are often easier to understand
than text explanations.</p>
<p>This tutorial supplements all explanations with clarifying "Try it Yourself" examples.</p>
<div class="w3-panel w3-note">
<p>If you try all the examples, you will learn a lot about JavaScript, in a very short time!</p>
<a class="ws-btn" href="js_examples.asp">JavaScript Examples »</a>
</div>
<hr>
<h2>Why Study JavaScript?</h2>
<p>JavaScript is one of the <strong>3 languages</strong> all web developers <strong>
must</strong>
learn:</p>
<p> 1. <a href="/html/default.asp"><strong>HTML</strong></a> to define the content of web pages</p>
<p> 2. <a href="/css/default.asp"><strong>CSS</strong></a> to specify the layout of web pages</p>
<p> 3. <strong>JavaScript</strong> to program the behavior of web pages </p>
<div class="w3-panel w3-info">
<p>This tutorial covers every version of JavaScript:</p>
<ul>
<li>The Original JavaScript ES1 ES2 ES3 (1997-1999)</li>
<li>The First Main Revision ES5 (2009)</li>
<li>The Second Revision ES6 (2015)</li>
<li>All Yearly Additions (2016, 2017, 2018, 2019, 2020)</li>
</ul>
</div>
<hr>
<div id="midcontentadcontainer" style="overflow:auto;text-align:center">
<!-- MidContent -->
<!-- <p class="adtext">Advertisement</p> -->
<div id="adngin-mid_content-0"></div>
</div>
<hr>
<h2>Learning Speed</h2>
<p>In this tutorial, the learning speed is your choice.</p>
<p>Everything is up to you.</p>
<p>If you are struggling, take a break, or re-read the material.</p>
<p><strong>Always</strong> make sure you understand <strong>all</strong> the "Try-it-Yourself"
examples.</p>
<p>The only way to become a clever programmer is to:
Practice. Practice. Practice. Code. Code. Code !</p>
<hr>
<form autocomplete="off" spellcheck="false" id="w3-exerciseform" action="exercise_js.asp?filename=exercise_js_variables1" method="post" target="_blank">
<h2>Test Yourself With Exercises</h2>
<div class="exercisewindow">
<h2>Exercise:</h2>
<p>Create a variable called <code class="w3-codespan">carName</code> and assign the value <code class="w3-codespan">Volvo</code> to it.</p>
<div class="exerciseprecontainer">
<pre>
var <input name="ex1" maxlength="7" style="width: 75px;"> = "<input name="ex2" maxlength="5" style="width: 54px;">";
</pre>
</div>
<br>
<button type="submit" class="w3-btn w3-margin-bottom">Submit Answer »</button>
<p><a target="_blank" href="exercise_js.asp?filename=exercise_js_variables1">Start the Exercise</a></p>
</div>
</form>
<hr>
<h2>Commonly Asked Questions</h2>
<ul>
<li>How do I get JavaScript?</li>
<li>Where can I download JavaScript?</li>
<li>Is JavaScript Free?</li>
</ul>
<b>
<p>You don't have to get or download JavaScript.</p>
<p>JavaScript is already running in your browser on your computer,
on your tablet, and on your smart-phone.</p>
<p>JavaScript is free to use for everyone.</p>
</b>
<hr>
<style>
#img_mylearning {
max-width:100%;
}
</style>
<h2>My Learning</h2>
<p>Track your progress with the free "My Learning" program here at W3Schools.</p>
<p>Log into your account, and start earning points!</p>
<p>This is an optional feature. You can study W3Schools without using My Learning.</p>
<a href="https://my-learning.w3schools.com/" target="_blank">
<img id="img_mylearning" src="/images/mylearning.png" style="max-width:100%;"></a>
<br>
<!--
<a class="ws-btn w3-margin-bottom"
href="https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fmy-learning.w3schools.com"
target="_blank"
style="font-size: 18px;padding-left:25px;padding-right:25px;
font-family : 'Source Sans Pro', sans-serif;