JavaScript Introduction
JavaScript Introduction
JavaScript Introduction
DOCTYPE html>
<!-- saved from url=(0041)https://www.w3schools.com/js/js_intro.asp -->
<html lang="en-US"><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><script async="" src="./JavaScript
Introduction_files/wrap.js.download"></script><script type="text/javascript"
async="" src="./JavaScript Introduction_files/localstore.js.download"></script>
<title>JavaScript Introduction</title>
k42 = true;
</script>
<script data-cfasync="false" type="text/javascript">
window.snigelPubConf = {
"adengine": {
}
}
uic_r_a()
</script>
<script async="" data-cfasync="false" src="./JavaScript
Introduction_files/loader.js.download" type="text/javascript"></script>
<script src="./JavaScript Introduction_files/common-deps.js.download"></script>
<script src="./JavaScript Introduction_files/user-session.js.download"></script>
<script src="./JavaScript Introduction_files/my-learning.js.download"></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>
.timelines-ext-right{
right: 0;
}
#timelines-ext *::-webkit-scrollbar {
display: block;
width: 8px;
height: 8px;
}
#timelines-ext *::-webkit-scrollbar-track {
background: #ECF0F5;
}
#timelines-ext *::-webkit-scrollbar-thumb {
background: #A5A5A5;
}</style><style data-styled="active" data-styled-version="5.3.6"></style><meta
http-equiv="origin-trial"
content="A0VQgOQvA+kwCj319NCwgf8+syUgEQ8/LLpB8RxxlRC3AkJ9xx8IAvVuQ/
dcwy0ok7sGKufLLu6WhsXbQR9/
UwwAAACFeyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiUHJpdmF
jeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjg4MDgzMTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaG
lyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial"
content="A6kRo9zXJhOvsR4D/VeZ9CiApPAxnOGzBkW88d8eIt9ex2oOzlX+AoUk/
BS50Y9Ysy2jwyHR49Mb7XwP+l9yygIAAACLeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9u
LmNvbTo0NDMiLCJmZWF0dXJlIjoiUHJpdmFjeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjg4MDgzMTk
5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-
equiv="origin-trial"
content="A3mbHZoS4VJtJ8j1aE8+Z9vaGf/oMV1eTNIWMrvGqWgNnOmvaxnRGliqKIZU2eiTzCj5Qpz8B1
/
UTTLuony5bAAAAACLeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZW
F0dXJlIjoiUHJpdmFjeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjg4MDgzMTk5LCJpc1N1YmRvbWFpb
iI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial"
content="As0hBNJ8h+
+fNYlkq8cTye2qDLyom8NddByiVytXGGD0YVE+2CEuTCpqXMDxdhOMILKoaiaYifwEvCRlJ/
9GcQ8AAAB8eyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiV2ViV
mlld1hSZXF1ZXN0ZWRXaXRoRGVwcmVjYXRpb24iLCJleHBpcnkiOjE3MTk1MzI3OTksImlzU3ViZG9tYWlu
Ijp0cnVlfQ=="><meta http-equiv="origin-trial"
content="AgRYsXo24ypxC89CJanC+JgEmraCCBebKl8ZmG7Tj5oJNx0cmH0NtNRZs3NB5ubhpbX/
bIt7l2zJOSyO64NGmwMAAACCeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDM
iLCJmZWF0dXJlIjoiV2ViVmlld1hSZXF1ZXN0ZWRXaXRoRGVwcmVjYXRpb24iLCJleHBpcnkiOjE3MTk1Mz
I3OTksImlzU3ViZG9tYWluIjp0cnVlfQ=="><script src="./JavaScript
Introduction_files/f(7).txt"
async=""></script><argprec0></argprec0><argprec1></argprec1><style
type="text/css">.snigel-cmp-framework .sn-inner {background-color:#fffefe!
important;}.snigel-cmp-framework .sn-b-def {border-color:#04aa6d!
important;color:#04aa6d!important;}.snigel-cmp-framework .sn-b-def.sn-blue
{color:#ffffff!important;background-color:#04aa6d!important;border-color:#04aa6d!
important;}.snigel-cmp-framework .sn-selector ul li {color:#04aa6d!
important;}.snigel-cmp-framework .sn-selector ul li:after {background-
color:#04aa6d!important;}.snigel-cmp-framework .sn-footer-tab .sn-privacy a
{color:#04aa6d!important;}.snigel-cmp-framework .sn-arrow:after,.snigel-cmp-
framework .sn-arrow:before {background-color:#04aa6d!important;}.snigel-cmp-
framework .sn-switch input:checked + span::before {background-color:#04aa6d!
important;}#adconsent-usp-link {border: 1px solid #04aa6d!important;color:#04aa6d!
important;}#adconsent-usp-banner-optout input:checked + .adconsent-usp-slider
{background-color:#04aa6d!important;}#adconsent-usp-banner-btn
{color:#ffffff;border: solid 1px #04aa6d!important;background-color:#04aa6d!
important; }</style><style type="text/css">.sn_ad_label{height:unset
!important}</style><script src="./JavaScript
Introduction_files/pubcid.min.js.download"></script><script src="./JavaScript
Introduction_files/id5-api.js.download"></script><iframe name="cnftComm"
style="display: none;" src="./JavaScript
Introduction_files/saved_resource(1).html"></iframe><link rel="preload"
href="./JavaScript Introduction_files/f(8).txt" as="script"><script
type="text/javascript" src="./JavaScript
Introduction_files/f(8).txt"></script><link rel="preload" href="./JavaScript
Introduction_files/f(9).txt" as="script"><script type="text/javascript"
src="./JavaScript Introduction_files/f(9).txt"></script><script esp-signal="true"
src="./JavaScript
Introduction_files/uid2SecureSignal.js.download"></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 ga-top" 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:#9763f6;
color:#fff;
}
.topnavmain_pro:hover {
background-color:#7d53cc!important;
color:#fff!important;
}
</style>
<div style="display: none; position: fixed; z-index: 4; right: 52px; height: 44px;
background-color: rgb(40, 42, 53); letter-spacing: normal; top: 0px;"
id="googleSearch">
<div class="gcse-search"></div>
</div>
<div style="display: none; position: fixed; z-index: 3; right: 111px; height: 44px;
background-color: rgb(40, 42, 53); text-align: right; padding-top: 9px; top: 0px;"
id="google_translate_element"></div>
<h3 class="w3-margin-top">Programming</h3>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/python/default.asp">Learn Python</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/java/default.asp">Learn Java</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/c/index.php">Learn C</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/cpp/default.asp">Learn C++</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/cs/index.php">Learn C#</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/r/default.asp">Learn R</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/kotlin/index.php">Learn Kotlin</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/go/index.php">Learn Go</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/django/index.php">Learn Django</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/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 ga-top-drop"
href="https://www.w3schools.com/sql/default.asp">Learn SQL</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/mysql/default.asp">Learn MySQL</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/php/default.asp">Learn PHP</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/asp/default.asp">Learn ASP</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/nodejs/default.asp">Learn Node.js</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp">Learn Raspberry
Pi</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/git/default.asp">Learn Git</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/mongodb/index.php">Learn MongoDB</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/aws/index.php">Learn AWS Cloud</a>
<h3 class="w3-margin-top">Programming</h3>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/python/python_reference.asp">Python Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/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 ga-top-drop"
href="https://www.w3schools.com/sql/sql_ref_keywords.asp">SQL Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/mysql/mysql_ref_functions.asp">MySQL Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/php/php_ref_overview.asp">PHP Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/asp/asp_ref_response.asp">ASP Reference</a>
<h3 class="w3-margin-top">XML</h3>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/xml/dom_nodetype.asp">XML DOM Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/xml/dom_http.asp">XML Http Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/xml/xsl_elementref.asp">XSLT Reference</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/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 ga-top-drop"
href="https://www.w3schools.com/charsets/default.asp">HTML Character Sets</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_ascii.asp">HTML ASCII</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_ansi.asp">HTML ANSI</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_ansi.asp">HTML Windows-1252</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_8859.asp">HTML ISO-8859-1</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_symbols.asp">HTML Symbols</a>
<a class="w3-bar-item w3-button ga-top-drop"
href="https://www.w3schools.com/charsets/ref_html_utf8.asp">HTML UTF-8</a>
</div>
</div>
<br class="hidesm">
</div>
</nav>
</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>
<h1>JavaScript <span class="color_h1">Introduction</span></h1>
<div class="w3-clear nextprev">
<a class="w3-left w3-btn"
href="https://www.w3schools.com/js/default.asp">❮ Previous</a>
<a class="w3-right w3-btn"
href="https://www.w3schools.com/js/js_whereto.asp">Next ❯</a>
</div>
<div class="w3-panel w3-info intro">
<p>This page contains some examples of what JavaScript can do.</p>
</div>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-code notranslate jsHigh"><span class="jscolor"
style="color:black"><span class="jsnumbercolor" style="color:red">
</span> document.<span class="jspropertycolor"
style="color:black">getElementById</span>(<span class="jsstringcolor"
style="color:brown">"demo"</span>).<span class="jspropertycolor"
style="color:black">innerHTML</span> = <span class="jsstringcolor"
style="color:brown">"Hello JavaScript"</span>; </span></div>
<a target="_blank" class="w3-btn w3-margin-bottom"
href="https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_inner_html">Try
it Yourself »</a>
</div>
<div class="w3-panel w3-note">
<p>JavaScript accepts both double and single quotes:</p>
</div>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-code notranslate jsHigh"><span class="jscolor"
style="color:black"><span class="jsnumbercolor" style="color:red">
</span> document.<span class="jspropertycolor"
style="color:black">getElementById</span>(<span class="jsstringcolor"
style="color:brown">'demo'</span>).<span class="jspropertycolor"
style="color:black">innerHTML</span> = <span class="jsstringcolor"
style="color:brown">'Hello JavaScript'</span>; </span></div>
<a class="w3-btn w3-margin-bottom" href="https://www.w3schools.com/js/tryit.asp?
filename=tryjs_intro_inner_html_quotes" target="_blank">Try it Yourself »</a>
</div>
<hr>
<div class="w3-example">
<h3>The Light Bulb</h3>
<div class="w3-padding-16 w3-white notranslate" style="text-
align:center;background-color:white!important;">
<button
onclick="document.getElementById('myImage').src='pic_bulbon.gif'">T
urn on the light</button>
<img id="myImage" border="0" src="./JavaScript Introduction_files/pic_bulboff.gif"
style="width:100px">
<button
onclick="document.getElementById('myImage').src='pic_bulboff.gif'">
Turn off the light</button>
</div>
<p>
<a class="w3-btn" href="https://www.w3schools.com/js/tryit.asp?
filename=tryjs_intro_lightbulb" target="_blank">Try it Yourself »</a>
</p>
</div>
<hr>
<div id="midcontentadcontainer" style="overflow:auto;text-align:center">
<!-- MidContent -->
<!-- <p class="adtext">Advertisement</p> -->
</div>
<hr>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-code notranslate jsHigh"><span class="jscolor"
style="color:black"><span class="jsnumbercolor" style="color:red">
</span> document.<span class="jspropertycolor"
style="color:black">getElementById</span>(<span class="jsstringcolor"
style="color:brown">"demo"</span>).<span class="jspropertycolor"
style="color:black">style</span>.<span class="jspropertycolor"
style="color:black">fontSize</span> = <span class="jsstringcolor"
style="color:brown">"35px"</span>; </span></div>
<a target="_blank" class="w3-btn w3-margin-bottom"
href="https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_style">Try it
Yourself »</a>
</div>
<hr>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-code notranslate jsHigh"><span class="jscolor"
style="color:black"><span class="jsnumbercolor" style="color:red">
</span> document.<span class="jspropertycolor"
style="color:black">getElementById</span>(<span class="jsstringcolor"
style="color:brown">"demo"</span>).<span class="jspropertycolor"
style="color:black">style</span>.<span class="jspropertycolor"
style="color:black">display</span> = <span class="jsstringcolor"
style="color:brown">"none"</span>; </span></div>
<a class="w3-btn w3-margin-bottom" href="https://www.w3schools.com/js/tryit.asp?
filename=tryjs_intro_hide" target="_blank">Try it Yourself »</a>
</div>
<hr>
<h2>JavaScript Can Show HTML Elements</h2>
<p>Showing hidden HTML elements can also be done by changing the <code class="w3-
codespan">display</code> style:</p>
<div class="w3-example">
<h3>Example</h3>
<div class="w3-code notranslate jsHigh"><span class="jscolor"
style="color:black"><span class="jsnumbercolor" style="color:red">
</span> document.<span class="jspropertycolor"
style="color:black">getElementById</span>(<span class="jsstringcolor"
style="color:brown">"demo"</span>).<span class="jspropertycolor"
style="color:black">style</span>.<span class="jspropertycolor"
style="color:black">display</span> = <span class="jsstringcolor"
style="color:brown">"block"</span>; </span></div>
<a class="w3-btn w3-margin-bottom" href="https://www.w3schools.com/js/tryit.asp?
filename=tryjs_intro_show" target="_blank">Try it Yourself »</a>
</div>
</div>
<div class="w3-col l2 m12" id="right">
<div class="sidesection">
<div id="skyscraper">
</div>
</div>
<style>
.ribbon-vid {
font-size:12px;
font-weight:bold;
padding: 6px 20px;
left:-20px;
top:-10px;
text-align: center;
color:black;
border-radius:25px;
}
</style>
<div class="sidesection">
<h4><a href="https://www.w3schools.com/colors/colors_picker.asp">COLOR
PICKER</a></h4>
<a href="https://www.w3schools.com/colors/colors_picker.asp" class="ga-right">
<img src="./JavaScript Introduction_files/colorpicker2000.png" alt="colorpicker"
loading="lazy">
</a>
</div>
<div class="sidesection">
<div class="sharethis" style="visibility: visible;">
<a href="https://www.facebook.com/w3schoolscom/" target="_blank"
title="Facebook"><span class="fa fa-facebook-square fa-2x ga-right"></span></a>
<a href="https://www.instagram.com/w3schools.com_official/" target="_blank"
title="Instagram"><span class="fa fa-instagram fa-2x ga-right"></span></a>
<a href="https://www.linkedin.com/company/w3schools.com/" target="_blank"
title="LinkedIn"><span class="fa fa-linkedin-square fa-2x ga-right"></span></a>
<a href="https://discord.gg/6Z7UaRbUQM" target="_blank" title="Join the
W3schools community on Discord"><span class="fa fa-discord fa-2x
ga-right"></span></a>
</div>
</div>
<style>
#courses_get_started_btn {
text-decoration:none !important;
background-color:#04AA6D;
width:100%;
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
padding-top:10px;
padding-bottom:10px;
font-family: 'Source Sans Pro', sans-serif;
}
#courses_get_started_btn:hover {
background-color:#059862!important;
}
</style>
<div id="internalCourses" class="sidesection">
<p style="font-size:18px;padding-left:2px;padding-right:2px;">Get certified<br>by
completing<br><span id="courses_subject_text">a JavaScript<br></span> course today!
</p>
<a id="courses_subject_img_link"
href="https://campus.w3schools.com/collections/course-catalog/products/javascript-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad"
target="_blank" class="ga-right">
<div style="padding:0 20px 20px 20px">
<svg id="w3_cert_badge2" style="margin:auto;width:85%" data-name="w3_cert_badge2"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><defs><style>.cls-
1{fill:#04aa6b;}.cls-2{font-size:23px;}.cls-2,.cls-3,.cls-4{fill:#fff;}.cls-2,.cls-
3{font-family:RobotoMono-Medium, Roboto Mono;font-weight:500;}.cls-3{font-
size:20.08px;}</style></defs><circle class="cls-1" cx="150" cy="150" r="146.47"
transform="translate(-62.13 150) rotate(-45)"></circle><text class="cls-2"
transform="translate(93.54 63.89) rotate(-29.5)">w</text><text class="cls-2"
transform="translate(107.13 56.35) rotate(-20.8)">3</text><text class="cls-2"
transform="matrix(0.98, -0.21, 0.21, 0.98, 121.68, 50.97)">s</text><text
class="cls-2" transform="translate(136.89 47.84) rotate(-3.47)">c</text><text
class="cls-2" transform="translate(152.39 47.03) rotate(5.12)">h</text><text
class="cls-2" transform="translate(167.85 48.54) rotate(13.72)">o</text><text
class="cls-2" transform="translate(182.89 52.35) rotate(22.34)">o</text><text
class="cls-2" transform="matrix(0.86, 0.52, -0.52, 0.86, 197.18,
58.36)">l</text><text class="cls-2" transform="matrix(0.77, 0.64, -0.64, 0.77,
210.4, 66.46)">s</text><text class="cls-3" transform="translate(35.51 186.66)
rotate(69.37)"> </text><text class="cls-3" transform="matrix(0.47, 0.88, -0.88,
0.47, 41.27, 201.28)">C</text><text class="cls-3" transform="matrix(0.58, 0.81, -
0.81, 0.58, 48.91, 215.03)">E</text><text class="cls-3" transform="matrix(0.67,
0.74, -0.74, 0.67, 58.13, 227.36)">R</text><text class="cls-3"
transform="translate(69.16 238.92) rotate(39.44)">T</text><text class="cls-3"
transform="matrix(0.85, 0.53, -0.53, 0.85, 81.47, 248.73)">I</text><text
class="cls-3" transform="translate(94.94 256.83) rotate(24.36)">F</text><text
class="cls-3" transform="translate(109.34 263.09) rotate(16.83)">I</text><text
class="cls-3" transform="translate(124.46 267.41) rotate(9.34)">E</text><text
class="cls-3" transform="translate(139.99 269.73) rotate(1.88)">D</text><text
class="cls-3" transform="translate(155.7 270.01) rotate(-5.58)"> </text><text
class="cls-3" transform="translate(171.32 268.24) rotate(-13.06)"> </text><text
class="cls-2" transform="translate(187.55 266.81) rotate(-21.04)">.</text><text
class="cls-3" transform="translate(203.27 257.7) rotate(-29.24)"> </text><text
class="cls-3" transform="translate(216.84 249.83) rotate(-36.75)"> </text><text
class="cls-3" transform="translate(229.26 240.26) rotate(-44.15)">2</text><text
class="cls-3" transform="translate(240.39 229.13) rotate(-51.62)">0</text><text
class="cls-3" transform="translate(249.97 216.63) rotate(-59.17)">2</text><text
class="cls-3" transform="matrix(0.4, -0.92, 0.92, 0.4, 257.81,
203.04)">3</text><path class="cls-4" d="M196.64,136.31s3.53,3.8,8.5,3.8c3.9,0,6.75-
2.37,6.75-5.59,0-4-3.64-5.81-8-5.81h-2.59l-1.53-3.48,6.86-
8.13a34.07,34.07,0,0,1,2.7-2.85s-1.11,0-3.33,0H194.79v-5.86H217.7v4.28l-
9.19,10.61c5.18.74,10.24,4.43,10.24,10.92s-4.85,12.3-13.19,12.3a17.36,17.36,0,0,1-
12.41-5Z"></path><path class="cls-4" d="M152,144.24l30.24,53.86,14.94-
26.61L168.6,120.63H135.36l-13.78,24.53-13.77-
24.53H77.93l43.5,77.46.15-.28.16.28Z"></path></svg>
</div>
</a>
<a class="w3-btn ga-right" id="courses_get_started_btn"
href="https://campus.w3schools.com/collections/course-catalog/products/javascript-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad"
target="_blank">Get started</a>
</div>
<script>
var internalFeatureRnd = Math.floor(Math.random() * (5 - 1)) + 1;
var upshowcase120 = document.getElementById("upperfeatureshowcase120");
var upshowcase160 = document.getElementById("upperfeatureshowcase160");
var upshowcase300 = document.getElementById("upperfeatureshowcase300");
var upshowcase3001 = document.getElementById("upperfeatureshowcase3001");
var upshowcaselink = document.getElementById("upperfeatureshowcaselink");
var lowshowcase120 = document.getElementById("lowerfeatureshowcase120");
var lowshowcase160 = document.getElementById("lowerfeatureshowcase160");
var lowshowcase300 = document.getElementById("lowerfeatureshowcase300");
var lowshowcase3001 = document.getElementById("lowerfeatureshowcase3001");
var lowshowcaselink = document.getElementById("lowerfeatureshowcaselink");
if (internalFeatureRnd == 2) {
upshowcase120.srcset = "/images/img_subs_120.png";
upshowcase160.srcset = "/images/img_subs_160.png";
upshowcase300.srcset = "/images/img_subs_300.png";
upshowcase3001.srcset = "/images/img_subs_300.png";
upshowcaselink.href = "https://www.w3schools.com/spaces/";
upshowcaselink.classList.remove("showcasebackend");
upshowcaselink.classList.add("showcasesubs");
lowshowcase120.srcset = "/images/img_bootcamp_120.png";
lowshowcase160.srcset = "/images/img_bootcamp_160.png";
lowshowcase300.srcset = "/images/img_bootcamp_300.png";
lowshowcase3001.srcset = "/images/img_bootcamp_300.png";
lowshowcaselink.href = "https://www.w3schools.com/bootcamp/";
lowshowcaselink.classList.remove("showcasesubs");
lowshowcaselink.classList.add("showcasebootcamp");
} else if (internalFeatureRnd == 3) {
upshowcase120.srcset = "/images/img_bootcamp_120.png";
upshowcase160.srcset = "/images/img_bootcamp_160.png";
upshowcase300.srcset = "/images/img_bootcamp_300.png";
upshowcase3001.srcset = "/images/img_bootcamp_300.png";
upshowcaselink.href = "https://www.w3schools.com/bootcamp/";
upshowcaselink.classList.remove("showcasebackend");
upshowcaselink.classList.add("showcasebootcamp");
lowshowcase120.srcset = "/images/img_fullaccess3_120.png";
lowshowcase160.srcset = "/images/img_fullaccess3_160.png";
lowshowcase300.srcset = "/images/img_fullaccess3_300.png";
lowshowcase3001.srcset = "/images/img_fullaccess3_300.png";
lowshowcaselink.href =
"https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-
access-course";
lowshowcaselink.classList.remove("showcasesubs");
lowshowcaselink.classList.add("showcasefullaccess");
} else if (internalFeatureRnd == 4) {
upshowcase120.srcset = "/images/img_fullaccess3_120.png";
upshowcase160.srcset = "/images/img_fullaccess3_160.png";
upshowcase300.srcset = "/images/img_fullaccess3_300.png";
upshowcase3001.srcset = "/images/img_fullaccess3_300.png";
upshowcaselink.href =
"https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-
access-course";
upshowcaselink.classList.remove("showcasebackend");
upshowcaselink.classList.add("showcasefullaccess");
lowshowcase120.srcset = "/images/img_backend_120.png";
lowshowcase160.srcset = "/images/img_backend_160.png";
lowshowcase300.srcset = "/images/img_backend_300.png";
lowshowcase3001.srcset = "/images/img_backend_300.png";
lowshowcaselink.href = "https://www.w3schools.com/spaces/";
lowshowcaselink.classList.remove("showcasesubs");
lowshowcaselink.classList.add("showcasebackend");
}
function addTryitSpaces(subject) {
let spacesButt = document.createElement("a");
let ribb = document.createElement("span");
spacesButt.innerHTML="Get your own " + subject + " Server"
spacesButt.classList.add("ws-black", "ws-hover-black", "spaces-tryit", "ga-
featured");
spacesButt.href="https://www.w3schools.com/spaces/";
spacesButt.setAttribute("title", "W3Schools Spaces");
spacesButt.setAttribute("target", "_blank");
switch (subjectFolder) {
case "cpp":
subjectText = "C++";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/c-course-1?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "java":
subjectText = "Java";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/java-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
addTryitSpaces(subjectText);
break;
case "bootstrap4":
subjectText = "Bootstrap 4";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/bootstrap-4-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "xml":
subjectText = "XML";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/xml-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "jquery":
subjectText = "jQuery";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/jquery-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "accessibility":
subjectText = "Accessibility";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/accessibility-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "bootstrap":
subjectText = "Bootstrap 3";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/bootstrap-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "html":
subjectText = "HTML";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/html-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "tags":
subjectText = "HTML";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/html-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "css":
subjectText = "CSS";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/css-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "cssref":
subjectText = "CSS";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/css-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "js":
subjectText = "JavaScript";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/javascript-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "jsref":
subjectText = "JavaScript";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/javascript-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "react":
subjectText = "React.js";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/react-js-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_react.png";
upshowcase160.srcset = "/images/img_backend_160_react.png";
upshowcase300.srcset = "/images/img_backend_300_react.png";
upshowcase3001.srcset = "/images/img_backend_300_react.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_react.png";
lowshowcase160.srcset = "/images/img_backend_160_react.png";
lowshowcase300.srcset = "/images/img_backend_300_react.png";
lowshowcase3001.srcset = "/images/img_backend_300_react.png";
}
addTryitSpaces(subjectText);
break;
case "sql":
subjectText = "SQL";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/sql-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
addTryitSpaces(subjectText);
break;
case "mysql":
addTryitSpaces("SQL");
break;
case "php":
subjectText = "PHP";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/php-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_php.png";
upshowcase160.srcset = "/images/img_backend_160_php.png";
upshowcase300.srcset = "/images/img_backend_300_php.png";
upshowcase3001.srcset = "/images/img_backend_300_php.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_php.png";
lowshowcase160.srcset = "/images/img_backend_160_php.png";
lowshowcase300.srcset = "/images/img_backend_300_php.png";
lowshowcase3001.srcset = "/images/img_backend_300_php.png";
}
addTryitSpaces(subjectText);
break;
case "cybersecurity":
subjectText = "Cyber Security";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/cyber-security-
course?utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "r":
subjectText = "R";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/r-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
break;
case "numpy":
subjectText = "Numpy";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/numpy-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_numpy.png";
upshowcase160.srcset = "/images/img_backend_160_numpy.png";
upshowcase300.srcset = "/images/img_backend_300_numpy.png";
upshowcase3001.srcset = "/images/img_backend_300_numpy.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_numpy.png";
lowshowcase160.srcset = "/images/img_backend_160_numpy.png";
lowshowcase300.srcset = "/images/img_backend_300_numpy.png";
lowshowcase3001.srcset = "/images/img_backend_300_numpy.png";
}
addTryitSpaces("Python");
break;
case "django":
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_django.png";
upshowcase160.srcset = "/images/img_backend_160_django.png";
upshowcase300.srcset = "/images/img_backend_300_django.png";
upshowcase3001.srcset = "/images/img_backend_300_django.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_django.png";
lowshowcase160.srcset = "/images/img_backend_160_django.png";
lowshowcase300.srcset = "/images/img_backend_300_django.png";
lowshowcase3001.srcset = "/images/img_backend_300_django.png";
}
addTryitSpaces("Django");
break;
case "typescript":
subjectText = "TypeScript";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/learn-typescript?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_ts.png";
upshowcase160.srcset = "/images/img_backend_160_ts.png";
upshowcase300.srcset = "/images/img_backend_300_ts.png";
upshowcase3001.srcset = "/images/img_backend_300_ts.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_ts.png";
lowshowcase160.srcset = "/images/img_backend_160_ts.png";
lowshowcase300.srcset = "/images/img_backend_300_ts.png";
lowshowcase3001.srcset = "/images/img_backend_300_ts.png";
}
addTryitSpaces("TypeScript");
break;
case "nodejs":
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_node.png";
upshowcase160.srcset = "/images/img_backend_160_node.png";
upshowcase300.srcset = "/images/img_backend_300_node.png";
upshowcase3001.srcset = "/images/img_backend_300_node.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_node.png";
lowshowcase160.srcset = "/images/img_backend_160_node.png";
lowshowcase300.srcset = "/images/img_backend_300_node.png";
lowshowcase3001.srcset = "/images/img_backend_300_node.png";
}
addTryitSpaces("Node.js");
break;
case "pandas":
subjectText = "Pandas";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/pandas-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_pandas.png";
upshowcase160.srcset = "/images/img_backend_160_pandas.png";
upshowcase300.srcset = "/images/img_backend_300_pandas.png";
upshowcase3001.srcset = "/images/img_backend_300_pandas.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_pandas.png";
lowshowcase160.srcset = "/images/img_backend_160_pandas.png";
lowshowcase300.srcset = "/images/img_backend_300_pandas.png";
lowshowcase3001.srcset = "/images/img_backend_300_pandas.png";
}
addTryitSpaces("Python");
break;
case "python":
subjectText = "Python";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/python-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
if (upshowcaselink.classList.contains("showcasebackend") == true) {
upshowcase120.srcset = "/images/img_backend_120_python.png";
upshowcase160.srcset = "/images/img_backend_160_python.png";
upshowcase300.srcset = "/images/img_backend_300_python.png";
upshowcase3001.srcset = "/images/img_backend_300_python.png";
} else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
lowshowcase120.srcset = "/images/img_backend_120_python.png";
lowshowcase160.srcset = "/images/img_backend_160_python.png";
lowshowcase300.srcset = "/images/img_backend_300_python.png";
lowshowcase3001.srcset = "/images/img_backend_300_python.png";
}
addTryitSpaces(subjectText);
break;
case "cs":
subjectText = "C#";
subjectLink =
"https://campus.w3schools.com/collections/course-catalog/products/c-course?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
addTryitSpaces(subjectText);
break;
case "vue":
addTryitSpaces("Vue");
break;
default:
subjectText = "a";
subjectLink = "https://campus.w3schools.com/collections/course-catalog?
utm_source=classic&utm_medium=tutorials&utm_campaign=right-side-ad";
}
if (typeof subjectText == 'undefined') {
subjectText = "a";
subjectLink = "https://campus.w3schools.com/collections/course-catalog";
}
if (subjectText != "a") {
document.getElementById("courses_subject_text").innerHTML = "a " + subjectText +
"<br>";
document.getElementById("courses_subject_img_link").href = subjectLink;
document.getElementById("courses_get_started_btn").href = subjectLink;
}
</script>
</div>
</div>
</div>
<script>
uic_r_c()
</script>
</div>
</div>
<div id="footer" class="footer w3-container w3-white">
<hr>
<div style="overflow:auto">
<div class="bottomad">
<!-- BottomMediumRectangle -->
<!--<pre>bottom_medium_rectangle, all: [970,250][300,250][336,280]</pre>-->
<div id="adngin-bottom_left-0" style="padding:0 10px 10px
0;float:left;width:auto;" data-google-query-id="CIGg_eX-5_4CFVFtfQod6EoOdA"><div
id="sn_ad_label_adngin-bottom_left-0" class="sn_ad_label"
style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</
div><div
id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//bottom_medium_recta
ngle_0__container__" style="border: 0pt none;"><iframe
id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//bottom_medium_recta
ngle_0" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//
bottom_medium_rectangle_0" title="3rd party ad content" width="970" height="250"
scrolling="no" marginwidth="0" marginheight="0" frameborder="0" role="region" aria-
label="Advertisement" tabindex="0" style="border: 0px; vertical-align: bottom;"
data-load-complete="true" data-google-container-id="5" src="./JavaScript
Introduction_files/saved_resource(5).html"></iframe></div></div>
<!-- adspace bmr -->
<!-- RightBottomMediumRectangle -->
<!--<pre>right_bottom_medium_rectangle, desktop: [300,250][336,280]</pre>-->
<div id="adngin-bottom_right-0" style="padding:0 10px 10px
0;float:left;width:auto;" data-google-query-id="CN7_-uX-5_4CFVFtfQod6EoOdA"><div
id="sn_ad_label_adngin-bottom_right-0" class="sn_ad_label"
style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</
div><div
id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//right_bottom_medium
_rectangle_0__container__" style="border: 0pt none;"><iframe
id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//right_bottom_medium
_rectangle_0" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//
right_bottom_medium_rectangle_0" title="3rd party ad content" width="300"
height="250" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"
role="region" aria-label="Advertisement" tabindex="0" style="border: 0px; vertical-
align: bottom;" data-load-complete="true" data-google-container-id="6"
src="./JavaScript Introduction_files/saved_resource(6).html"></iframe></div></div>
</div>
</div>
<hr>
<div class="w3-row-padding w3-center w3-small" style="margin:auto">
</div>
<hr>
<div class="ws-grey w3-padding w3-margin-bottom" id="err_form"
style="display:none;position:relative">
<span onclick="this.parentElement.style.display='none'" class="w3-button
w3-display-topright w3-large">×</span>
<h2>Report Error</h2>
<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:</p>
<p>help@w3schools.com</p>
<br>
</div>
<div class="w3-container ws-grey w3-padding" id="err_sent"
style="display:none;position:relative">
<span onclick="this.parentElement.style.display='none'" class="w3-button
w3-display-topright">×</span>
<h2>Thank You For Helping Us!</h2>
<p>Your message has been sent to W3Schools.</p>
</div>
</div>
</div>
</div>
<hr>
<div class="w3-opacity" style="font-size:12px;text-align:right;margin-
bottom:16px;margin-right:8px;">
<a href="https://www.w3schools.com/forum/default.asp" target="_blank"
class="xw3-text-grey xw3-hover-text-black ga-bottom" style="text-decoration:none"
title="Forum">FORUM</a> |
<a href="https://www.w3schools.com/about/default.asp" target="_top" class="xw3-
text-grey xw3-hover-text-black ga-bottom" style="text-decoration:none" title="About
W3Schools">ABOUT</a>
</div>
<script>
MyLearning.loadUser('footer', function () {
if (UserSession.loggedIn) {
document.getElementById("signupbtn_topnav").style.display = "none";
document.getElementById("spacesbtn_topnav").style.display = "block";
} else {
addMyLearnButt();
}
});
function docReady(fn) {
document.addEventListener("DOMContentLoaded", fn);
if (document.readyState === "interactive" || document.readyState === "complete"
) {
fn();
}
}
uic_r_z();
uic_r_d()
function addMyLearnButt() {
let nav = document.getElementsByClassName("nextprev");
if (document.body.contains(nav[1])) {
if ((nav[1].firstElementChild.innerHTML.indexOf("Previous") ||
nav[1].firstElementChild.innerHTML.indexOf("Home") !== -1) &&
(nav[1].firstElementChild.nextElementSibling.innerHTML.indexOf("Next") !== -1)) {
let myLearnButt = document.createElement("a");
myLearnButt.innerHTML="Log in to track progress";
myLearnButt.classList.add("w3-btn", "w3-hide-small", "myl-nav-butt");
myLearnButt.href="https://www.w3schools.com/signup/?
utm_source=classic&utm_medium=" + subjectFolder +
"_tutorial&utm_campaign=button_lower_navigation";
myLearnButt.setAttribute("title", "Sign Up and improve Your Learning
Experience");
myLearnButt.setAttribute("target", "_blank");
nav[1].classList.add("w3-center");
nav[1].firstElementChild.insertAdjacentElement("afterend", myLearnButt);
}
}
}
</script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function myFunction() {
let x;
let text = "Input OK";