You are on page 1of 17

Unión de líneas

1
2 <!DOCTYPE html>
3 <html lang="en-US">
4 <head>
5 <title>JavaScript Statements</title>
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8 <meta name="Keywords" content="HTML, Python, CSS, SQL, JavaScript, How to, PHP, Java, C, C++, C#, jQuery, Bootstrap, Colors, W3.CSS, XML, MySQL, Icons, N
9 <meta name="Description" content="Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript,
10 <meta property="og:image" content="https://www.w3schools.com/images/w3schools_logo_436_2.png">
11 <meta property="og:image:type" content="image/png">
12 <meta property="og:image:width" content="436">
13 <meta property="og:image:height" content="228">
14 <meta property="og:description" content="W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering
15 <link rel="icon" href="/favicon.ico" type="image/x-icon">
16 <link rel="preload" href="/lib/fonts/fontawesome.woff2?14663396" as="font" type="font/woff2" crossorigin>
17 <link rel="preload" href="/lib/fonts/source-code-pro-v14-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
18 <link rel="preload" href="/lib/fonts/roboto-mono-v13-latin-500.woff2" as="font" type="font/woff2" crossorigin>
19 <link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-700.woff2" as="font" type="font/woff2" crossorigin>
20 <link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-600.woff2" as="font" type="font/woff2" crossorigin>
21 <link rel="preload" href="/lib/fonts/freckle-face-v9-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
22 <link rel="stylesheet" href="/lib/w3schools31.css">
23
24 <!-- Google Tag Manager -->
25 <script>
26 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
27 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
28 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
29 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
30 })(window,document,'script','dataLayer','GTM-KTCFC3S');
31
32 var subjectFolder = location.pathname;
33 subjectFolder = subjectFolder.replace("/", "");
34 if (subjectFolder.startsWith("python/") == true ) {
35 if (subjectFolder.includes("/numpy/") == true ) {
36 subjectFolder = "numpy/"
37 } else if (subjectFolder.includes("/pandas/") == true ) {
38 subjectFolder = "pandas/"
39 } else if (subjectFolder.includes("/scipy/") == true ) {
40 subjectFolder = "scipy/"
41 }
42 }
43 subjectFolder = subjectFolder.substr(0, subjectFolder.indexOf("/"));
44 </script>
45 <!-- End Google Tag Manager -->
46
47 <script src="/lib/uic.js?v=1.0.5"></script>
48 <script data-cfasync="false" type="text/javascript">
49 var k42 = false;
50
51 k42 = true;
52
53 </script>
54 <script data-cfasync="false" type="text/javascript">
55 window.snigelPubConf = {
56 "adengine": {
57
58 "activeAdUnits": ["main_leaderboard", "sidebar_top", "bottom_left", "bottom_right"]
59
60 }
61 }
62 uic_r_a()
63 </script>
64 <script async data-cfasync="false" src="https://cdn.snigelweb.com/adengine/w3schools.com/loader.js" type="text/javascript"></script>
65 <script src="/lib/common-deps.js?v=1.0.1"></script>
66 <script src="/lib/user-session.js?v=1.0.28"></script>
67 <script src="/lib/my-learning.js?v=1.0.19"></script>
68 <script type='text/javascript'>
69 var stickyadstatus = "";
70 function fix_stickyad() {
71 document.getElementById("stickypos").style.position = "sticky";
72 var elem = document.getElementById("stickyadcontainer");
73 if (!elem) {return false;}
74 if (document.getElementById("skyscraper")) {
75 var skyWidth = Number(w3_getStyleValue(document.getElementById("skyscraper"), "width").replace("px", ""));
76 }
77 else {
78 var skyWidth = Number(w3_getStyleValue(document.getElementById("right"), "width").replace("px", ""));
79 }
80 elem.style.width = skyWidth + "px";
81 if (window.innerWidth <= 992) {
82 elem.style.position = "";
83 elem.style.top = stickypos + "px";
84 return false;
85 }
86 var stickypos = document.getElementById("stickypos").offsetTop;
87 var docTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
88 var adHeight = Number(w3_getStyleValue(elem, "height").replace("px", ""));
89 if (stickyadstatus == "") {
90 if ((stickypos - docTop) < 60) {
91 elem.style.position = "fixed";
92 elem.style.top = "60px";
93 stickyadstatus = "sticky";
94 document.getElementById("stickypos").style.position = "sticky";
95
96 }
97 } else {
98 if ((docTop + 60) - stickypos < 0) {
99 elem.style.position = "";
100 elem.style.top = stickypos + "px";
101 stickyadstatus = "";
102 document.getElementById("stickypos").style.position = "static";
103 }
104 }
105 if (stickyadstatus == "sticky") {
106 if ((docTop + adHeight + 60) > document.getElementById("footer").offsetTop) {
107 elem.style.position = "absolute";
108 elem.style.top = (document.getElementById("footer").offsetTop - adHeight) + "px";
109 document.getElementById("stickypos").style.position = "static";
110 } else {
111 elem.style.position = "fixed";
112 elem.style.top = "60px";
113 stickyadstatus = "sticky";
114 document.getElementById("stickypos").style.position = "sticky";
115 }
116 }
117 }
118 function w3_getStyleValue(elmnt,style) {
119 if (window.getComputedStyle) {
120 return window.getComputedStyle(elmnt,null).getPropertyValue(style);
121 } else {
122 return elmnt.currentStyle[style];
123 }
124 }
125 </script>
126
127 </head><body>
128 <!-- Google Tag Manager (noscript) -->
129 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KTCFC3S"
130 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
131 <!-- End Google Tag Manager (noscript) -->
132 <style>
133 #darkmodemenu {
134 position:absolute;
135 top:-40px;
136 right:16px;
137 padding:5px 20px 10px 18px;
138 border-bottom-left-radius:5px;
139 border-bottom-right-radius:5px;
140 z-index:-1;
141 transition: top 0.2s;
142 user-select: none;
143 }
144 #darkmodemenu input,#darkmodemenu label {
145 cursor:pointer;
146 }
147 </style>
148 <script>
149 (
150 function setThemeMode() {
151 var x = localStorage.getItem("preferredmode");
152 var y = localStorage.getItem("preferredpagemode");
153 if (x == "dark") {
154 document.body.className += " darktheme";
155 }
156 if (y == "dark") {
157 document.body.className += " darkpagetheme";
158 }
159 })();
160 </script>
161 <div id="pagetop" class="w3-bar w3-card-2 notranslate">
162 <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">
163 <i class="fa fa-logo ws-text-green ws-hover-text-green" style="position:relative;font-size:42px!important;"></i>
164 </a>
165
166 <style>
167 .topnavmain_pro {
168 background-color:#9763f6;
169 color:#fff;
170 }
171 .topnavmain_pro:hover {
172 background-color:#7d53cc!important;
173 color:#fff!important;
174 }
175
176 @media screen and (max-width: 1160px) {
177 .ws-hide-1160 {
178 display: none !important;
179 }
180 }
181 @media screen and (max-width: 1300px) {
182 .ws-hide-1300 {
183 display: none !important;
184 }
185 }
186 @media screen and (max-width: 700px) {
187 .ws-hide-700 {
188 display: none !important;
189 }
190 }
191 @media screen and (max-width:380px) {
192 #w3loginbtn {
193 width:90px!important;
194 padding-left:2px!important;
195 padding-right:2px;
196 }
197 #signupbtn_topnav,#spacesbtn_topnav {
198 display:none!important;
199 }
200 }
201
202 </style>
203
204 <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="navb
205 <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="nav
206 <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
207
208 <a class="w3-bar-item w3-button bar-item-hover w3-padding-24 barex ws-hide-1300" href="/bootcamp/index.php" title="Web Development Bootcamp">Bootcamp</
209
210 <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:
211
212 <div id="loginactioncontainer" class="w3-right w3-padding-16" style="margin-left:1px;width:55px">
213 <div id="mypagediv"></div>
214 <!-- <button id="w3loginbtn" style="border:none;display:none;cursor:pointer" class="login w3-right w3-hover-greener" onclick='w3_open_nav("login")'
215 <a id="w3loginbtn" title="Login to your account" class="w3-bar-item w3-btn bar-item-hover w3-right ws-light-green" style="display:none;width:112px;
216 </div>
217
218 <div class="w3-right w3-padding-16">
219 <a id="spacesbtn_topnav" style="display:none;width: 93px;border-radius: 25px; margin-right: 20px;" class="w3-bar-item w3-button w3-right w3x-hide-sma
220 <a id="signupbtn_topnav" class="w3-bar-item w3-button w3-right barex ws-green ws-hover-green" style="width: 93px;border-radius: 25px; margin-right: 2
221 <a class="w3-bar-item w3-button w3-right ws-hide-1066 w3-hide-small barex ws-yellow ws-hover-yellow gt-btn-top-spaces" style="width: 150px;border-rad
222 <a class="w3-bar-item w3-button w3-right ws-hide-900 w3-hide-small barex ws-pink ws-hover-pink gt-btn-top-cert" style="border-radius: 25px; margin-ri
223 <a class="w3-bar-item w3-button w3-right w3-hide-small ws-hide-1160 barex topnavmain_pro gt-btn-top-pro" style="border-radius: 25px; margin-right: 15
224 <!-- <a class="ws-light-green ws-hover-green w3-bar-item w3-button w3-right w3-hide-small ws-hide-1300 barex" style="border-radius: 25px; margin-right
225 </div>
226 </div>
227
228 <div style='display:none;position:absolute;z-index:4;right:52px;height:44px;background-color:#282A35;letter-spacing:normal;' id='googleSearch'>
229 <div class='gcse-search'></div>
230 </div>
231 <div style='display:none;position:absolute;z-index:3;right:111px;height:44px;background-color:#282A35;text-align:right;padding-top:9px;' id='google_trans
232
233 <div class='w3-card-2 topnav notranslate' id='topnav'>
234 <div style="overflow:auto;">
235 <div class="w3-bar w3-left" style="width:100%;overflow:hidden;height:44px">
236 <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>
237 <a href='/default.asp' class='topnav-icons fa fa-home w3-left w3-bar-item w3-button' title='Home'></a>
238 <a class="w3-bar-item w3-button" href='/html/default.asp' title='HTML Tutorial' style="padding-left:18px!important;padding-right:18px!important;">H
239 <a class="w3-bar-item w3-button" href='/css/default.asp' title='CSS Tutorial'>CSS</a>
240 <a class="w3-bar-item w3-button" href='/js/default.asp' title='JavaScript Tutorial'>JAVASCRIPT</a>
241 <a class="w3-bar-item w3-button" href='/sql/default.asp' title='SQL Tutorial'>SQL</a>
242 <a class="w3-bar-item w3-button" href='/python/default.asp' title='Python Tutorial'>PYTHON</a>
243 <a class="w3-bar-item w3-button" href='/java/default.asp' title='Java Tutorial'>JAVA</a>
244 <a class="w3-bar-item w3-button" href='/php/default.asp' title='PHP Tutorial'>PHP</a>
245 <a class="w3-bar-item w3-button" href='/bootstrap/bootstrap_ver.asp' title='Bootstrap Tutorial'>BOOTSTRAP</a>
246 <a class="w3-bar-item w3-button" href='/howto/default.asp' title='How To'>HOW TO</a>
247 <a class="w3-bar-item w3-button" href='/w3css/default.asp' title='W3.CSS Tutorial'>W3.CSS</a>
248 <a class="w3-bar-item w3-button" href='/c/index.php' title='C Tutorial'>C</a>
249 <a class="w3-bar-item w3-button" href='/cpp/default.asp' title='C++ Tutorial'>C++</a>
250 <a class="w3-bar-item w3-button" href='/cs/index.php' title='C# Tutorial'>C#</a>
251 <a class="w3-bar-item w3-button" href='/react/default.asp' title='React Tutorial'>REACT</a>
252 <a class="w3-bar-item w3-button" href='/r/default.asp' title='R Tutorial'>R</a>
253 <a class="w3-bar-item w3-button" href='/jquery/default.asp' title='jQuery Tutorial'>JQUERY</a>
254 <a class="w3-bar-item w3-button" href='/django/index.php' title='Django Tutorial'>DJANGO</a>
255 <a class="w3-bar-item w3-button" href='/typescript/index.php' title='Typescript Tutorial'>TYPESCRIPT</a>
256 <a class="w3-bar-item w3-button" href='/nodejs/default.asp' title='NodeJS Tutorial'>NODEJS</a>
257 <a class="w3-bar-item w3-button" href='/mysql/default.asp' title='MySQL Tutorial'>MYSQL</a>
258 <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='gSearch(this)' title='Search W3Schools'>&#xe802;</a>
259 <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='gTra(this)' title='Translate W3Schools'>&#xe801;</a>
260 <!-- <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='changecodetheme(this)' title='Toggle Dark Code Ex
261 <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkic
262
263
264 <!--
265 <a class="w3-bar-item w3-button w3-right" id='topnavbtn_exercises' href='javascript:void(0);' onclick='w3_open_nav("exercises")' title='Exercises'>
266 -->
267
268 </div>
269
270 <div id="darkmodemenu" class="ws-black" onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkicon()">
271 <input id="radio_darkpage" type="checkbox" name="radio_theme_mode" onclick="click_darkpage()"><label for="radio_darkpage"> Dark mode</label>
272 <br>
273 <input id="radio_darkcode" type="checkbox" name="radio_theme_mode" onclick="click_darkcode()"><label for="radio_darkcode"> Dark code</label>
274 </div>
275
276 <nav id="nav_tutorials" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
277 <div class="w3-content" style="max-width:1100px;font-size:18px">
278 <span onclick="w3_close_nav('tutorials')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30
279 <div class="w3-row-padding w3-bar-block">
280 <div class="w3-container" style="padding-left:13px">
281 <h2 style="color:#FFF4A3;"><b>Tutorials</b></h2>
282 </div>
283 <div class="w3-col l3 m6">
284 <h3 class="w3-margin-top">HTML and CSS</h3>
285 <a class="w3-bar-item w3-button" href="/html/default.asp">Learn HTML</a>
286 <a class="w3-bar-item w3-button" href="/css/default.asp">Learn CSS</a>
287 <a class="w3-bar-item w3-button" href="/css/css_rwd_intro.asp" title="Responsive Web Design">Learn RWD</a>
288 <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_ver.asp">Learn Bootstrap</a>
289 <a class="w3-bar-item w3-button" href="/w3css/default.asp">Learn W3.CSS</a>
290 <a class="w3-bar-item w3-button" href="/colors/default.asp">Learn Colors</a>
291 <a class="w3-bar-item w3-button" href="/icons/default.asp">Learn Icons</a>
292 <a class="w3-bar-item w3-button" href="/graphics/default.asp">Learn Graphics</a>
293 <a class="w3-bar-item w3-button" href='/graphics/svg_intro.asp'>Learn SVG</a>
294 <a class="w3-bar-item w3-button" href='/graphics/canvas_intro.asp'>Learn Canvas</a>
295 <a class="w3-bar-item w3-button" href="/howto/default.asp">Learn How To</a>
296 <a class="w3-bar-item w3-button" href="/sass/default.php">Learn Sass</a>
297 <div class="w3-hide-large w3-hide-small">
298 <h3 class="w3-margin-top">Data Analytics</h3>
299 <a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a>
300 <a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a>
301 <a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a>
302 <a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a>
303 <a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a>
304 <a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a>
305 <a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a>
306 <a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a>
307 <a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a>
308
309 <h3 class="w3-margin-top">XML Tutorials</h3>
310 <a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a>
311 <a class="w3-bar-item w3-button" href='/xml/ajax_intro.asp'>Learn XML AJAX</a>
312 <a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a>
313 <a class="w3-bar-item w3-button" href='/xml/xml_dtd_intro.asp'>Learn XML DTD</a>
314 <a class="w3-bar-item w3-button" href='/xml/schema_intro.asp'>Learn XML Schema</a>
315 <a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a>
316 <a class="w3-bar-item w3-button" href='/xml/xpath_intro.asp'>Learn XPath</a>
317 <a class="w3-bar-item w3-button" href='/xml/xquery_intro.asp'>Learn XQuery</a>
318 </div>
319 </div>
320 <div class="w3-col l3 m6">
321 <h3 class="w3-margin-top">JavaScript</h3>
322 <a class="w3-bar-item w3-button" href="/js/default.asp">Learn JavaScript</a>
323 <a class="w3-bar-item w3-button" href="/jquery/default.asp">Learn jQuery</a>
324 <a class="w3-bar-item w3-button" href="/react/default.asp">Learn React</a>
325 <a class="w3-bar-item w3-button" href="/angular/default.asp">Learn AngularJS</a>
326 <a class="w3-bar-item w3-button" href="/js/js_json_intro.asp">Learn JSON</a>
327 <a class="w3-bar-item w3-button" href="/js/js_ajax_intro.asp">Learn AJAX</a>
328 <a class="w3-bar-item w3-button" href="/appml/default.asp">Learn AppML</a>
329 <a class="w3-bar-item w3-button" href="/w3js/default.asp">Learn W3.JS</a>
330
331 <h3 class="w3-margin-top">Programming</h3>
332 <a class="w3-bar-item w3-button" href="/python/default.asp">Learn Python</a>
333 <a class="w3-bar-item w3-button" href="/java/default.asp">Learn Java</a>
334 <a class="w3-bar-item w3-button" href="/c/index.php">Learn C</a>
335 <a class="w3-bar-item w3-button" href="/cpp/default.asp">Learn C++</a>
336 <a class="w3-bar-item w3-button" href="/cs/index.php">Learn C#</a>
337 <a class="w3-bar-item w3-button" href="/r/default.asp">Learn R</a>
338 <a class="w3-bar-item w3-button" href="/kotlin/index.php">Learn Kotlin</a>
339 <a class="w3-bar-item w3-button" href="/go/index.php">Learn Go</a>
340 <a class="w3-bar-item w3-button" href="/django/index.php">Learn Django</a>
341 <a class="w3-bar-item w3-button" href="/typescript/index.php">Learn TypeScript</a>
342 </div>
343 <div class="w3-col l3 m6">
344 <h3 class="w3-margin-top">Server Side</h3>
345 <a class="w3-bar-item w3-button" href="/sql/default.asp">Learn SQL</a>
346 <a class="w3-bar-item w3-button" href="/mysql/default.asp">Learn MySQL</a>
347 <a class="w3-bar-item w3-button" href="/php/default.asp">Learn PHP</a>
348 <a class="w3-bar-item w3-button" href='/asp/default.asp'>Learn ASP</a>
349 <a class="w3-bar-item w3-button" href='/nodejs/default.asp'>Learn Node.js</a>
350 <a class="w3-bar-item w3-button" href='/nodejs/nodejs_raspberrypi.asp'>Learn Raspberry Pi</a>
351 <a class="w3-bar-item w3-button" href='/git/default.asp'>Learn Git</a>
352 <a class="w3-bar-item w3-button" href='/mongodb/index.php'>Learn MongoDB</a>
353 <a class="w3-bar-item w3-button" href='/aws/index.php'>Learn AWS Cloud</a>
354
355 <h3 class="w3-margin-top">Web Building</h3>
356 <a class="w3-bar-item w3-button" href="/spaces/index.html" title="Get Your Own Website With W3shools Spaces">Create a Website <span class="ribbon-topn
357 <a class="w3-bar-item w3-button" href="/where_to_start.asp">Where To Start</a>
358 <a class="w3-bar-item w3-button" href="/w3css/w3css_templates.asp">Web Templates</a>
359 <a class="w3-bar-item w3-button" href="/browsers/default.asp">Web Statistics</a>
360 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com" target="_blank">Web Certificates</a>
361 <a class="w3-bar-item w3-button" href="/whatis/default.asp">Web Development</a>
362 <a class="w3-bar-item w3-button" href='/tryit/default.asp'>Code Editor</a>
363 <a class="w3-bar-item w3-button" href="/typingspeed/default.asp">Test Your Typing Speed</a>
364 <a class="w3-bar-item w3-button" href="/codegame/index.html" target="_blank">Play a Code Game</a>
365 <a class="w3-bar-item w3-button" href="/cybersecurity/index.php">Cyber Security</a>
366 <a class="w3-bar-item w3-button" href="/accessibility/index.php">Accessibility</a>
367 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/pages/newsletter" target="_blank">Join our Newsletter</a>
368 </div>
369 <div class="w3-col l3 m6 w3-hide-medium">
370 <h3 class="w3-margin-top">Data Analytics</h3>
371 <a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a>
372 <a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a>
373 <a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a>
374 <a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a>
375 <a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a>
376 <a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a>
377 <a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a>
378 <a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a>
379 <a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a>
380 <a class="w3-bar-item w3-button" href="/googlesheets/index.php">Learn Google Sheets</a>
381
382 <h3 class="w3-margin-top">XML Tutorials</h3>
383 <a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a>
384 <a class="w3-bar-item w3-button" href='/xml/ajax_intro.asp'>Learn XML AJAX</a>
385 <a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a>
386 <a class="w3-bar-item w3-button" href='/xml/xml_dtd_intro.asp'>Learn XML DTD</a>
387 <a class="w3-bar-item w3-button" href='/xml/schema_intro.asp'>Learn XML Schema</a>
388 <a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a>
389 <a class="w3-bar-item w3-button" href='/xml/xpath_intro.asp'>Learn XPath</a>
390 <a class="w3-bar-item w3-button" href='/xml/xquery_intro.asp'>Learn XQuery</a>
391 </div>
392 </div>
393 </div>
394 <br class="hidesm">
395 </nav>
396
397 <nav id="nav_references" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
398 <div class="w3-content" style="max-width:1100px;font-size:18px">
399 <span onclick="w3_close_nav('references')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:3
400 <div class="w3-row-padding w3-bar-block">
401 <div class="w3-container" style="padding-left:13px">
402 <h2 style="color:#FFF4A3;"><b>References</b></h2>
403 </div>
404 <div class="w3-col l3 m6">
405 <h3 class="w3-margin-top">HTML</h3>
406 <a class="w3-bar-item w3-button" href='/tags/default.asp'>HTML Tag Reference</a>
407 <a class="w3-bar-item w3-button" href='/tags/ref_html_browsersupport.asp'>HTML Browser Support</a>
408 <a class="w3-bar-item w3-button" href='/tags/ref_eventattributes.asp'>HTML Event Reference</a>
409 <a class="w3-bar-item w3-button" href='/colors/default.asp'>HTML Color Reference</a>
410 <a class="w3-bar-item w3-button" href='/tags/ref_attributes.asp'>HTML Attribute Reference</a>
411 <a class="w3-bar-item w3-button" href='/tags/ref_canvas.asp'>HTML Canvas Reference</a>
412 <a class="w3-bar-item w3-button" href='/graphics/svg_reference.asp'>HTML SVG Reference</a>
413 <a class="w3-bar-item w3-button" href='/graphics/google_maps_reference.asp'>Google Maps Reference</a>
414 <h3 class="w3-margin-top">CSS</h3>
415 <a class="w3-bar-item w3-button" href='/cssref/index.php'>CSS Reference</a>
416 <a class="w3-bar-item w3-button" href='/cssref/css3_browsersupport.asp'>CSS Browser Support</a>
417 <a class="w3-bar-item w3-button" href='/cssref/css_selectors.asp'>CSS Selector Reference</a>
418 <a class="w3-bar-item w3-button" href='/bootstrap/bootstrap_ref_all_classes.asp'>Bootstrap 3 Reference</a>
419 <a class="w3-bar-item w3-button" href='/bootstrap4/bootstrap_ref_all_classes.asp'>Bootstrap 4 Reference</a>
420 <a class="w3-bar-item w3-button" href='/w3css/w3css_references.asp'>W3.CSS Reference</a>
421 <a class="w3-bar-item w3-button" href='/icons/icons_reference.asp'>Icon Reference</a>
422 <a class="w3-bar-item w3-button" href='/sass/sass_functions_string.php'>Sass Reference</a>
423 </div>
424 <div class="w3-col l3 m6">
425 <h3 class="w3-margin-top">JavaScript</h3>
426 <a class="w3-bar-item w3-button" href='/jsref/default.asp'>JavaScript Reference</a>
427 <a class="w3-bar-item w3-button" href='/jsref/default.asp'>HTML DOM Reference</a>
428 <a class="w3-bar-item w3-button" href='/jquery/jquery_ref_overview.asp'>jQuery Reference</a>
429 <a class="w3-bar-item w3-button" href='/angular/angular_ref_directives.asp'>AngularJS Reference</a>
430 <a class="w3-bar-item w3-button" href="/appml/appml_reference.asp">AppML Reference</a>
431 <a class="w3-bar-item w3-button" href="/w3js/w3js_references.asp">W3.JS Reference</a>
432
433 <h3 class="w3-margin-top">Programming</h3>
434 <a class="w3-bar-item w3-button" href='/python/python_reference.asp'>Python Reference</a>
435 <a class="w3-bar-item w3-button" href='/java/java_ref_keywords.asp'>Java Reference</a>
436 </div>
437 <div class="w3-col l3 m6">
438 <h3 class="w3-margin-top">Server Side</h3>
439 <a class="w3-bar-item w3-button" href='/sql/sql_ref_keywords.asp'>SQL Reference</a>
440 <a class="w3-bar-item w3-button" href='/mysql/mysql_ref_functions.asp'>MySQL Reference</a>
441 <a class="w3-bar-item w3-button" href='/php/php_ref_overview.asp'>PHP Reference</a>
442 <a class="w3-bar-item w3-button" href='/asp/asp_ref_response.asp'>ASP Reference</a>
443 <h3 class="w3-margin-top">XML</h3>
444 <a class="w3-bar-item w3-button" href='/xml/dom_nodetype.asp'>XML DOM Reference</a>
445 <a class="w3-bar-item w3-button" href='/xml/dom_http.asp'>XML Http Reference</a>
446 <a class="w3-bar-item w3-button" href='/xml/xsl_elementref.asp'>XSLT Reference</a>
447 <a class="w3-bar-item w3-button" href='/xml/schema_elements_ref.asp'>XML Schema Reference</a>
448 </div>
449 <div class="w3-col l3 m6">
450 <h3 class="w3-margin-top">Character Sets</h3>
451 <a class="w3-bar-item w3-button" href='/charsets/default.asp'>HTML Character Sets</a>
452 <a class="w3-bar-item w3-button" href='/charsets/ref_html_ascii.asp'>HTML ASCII</a>
453 <a class="w3-bar-item w3-button" href='/charsets/ref_html_ansi.asp'>HTML ANSI</a>
454 <a class="w3-bar-item w3-button" href='/charsets/ref_html_ansi.asp'>HTML Windows-1252</a>
455 <a class="w3-bar-item w3-button" href='/charsets/ref_html_8859.asp'>HTML ISO-8859-1</a>
456 <a class="w3-bar-item w3-button" href='/charsets/ref_html_symbols.asp'>HTML Symbols</a>
457 <a class="w3-bar-item w3-button" href='/charsets/ref_html_utf8.asp'>HTML UTF-8</a>
458 </div>
459 </div>
460 <br class="hidesm">
461 </div>
462 </nav>
463
464 <nav id="nav_exercises" class="w3-hide-small" style="position:absolute;padding-bottom:60px;">
465 <div class="w3-content" style="max-width:1100px;font-size:18px">
466 <span onclick="w3_close_nav('exercises')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30
467 <div class="w3-row-padding w3-bar-block">
468 <div class="w3-container" style="padding-left:13px">
469 <h2 style="color:#FFF4A3;"><b>Exercises and Quizzes</b></h2>
470 </div>
471 <div class="w3-col l3 m6">
472 <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>
473 <a class="w3-bar-item w3-button" href="/html/html_exercises.asp">HTML Exercises</a>
474 <a class="w3-bar-item w3-button" href="/css/css_exercises.asp">CSS Exercises</a>
475 <a class="w3-bar-item w3-button" href="/js/js_exercises.asp">JavaScript Exercises</a>
476 <a class="w3-bar-item w3-button" href="/python/python_exercises.asp">Python Exercises</a>
477 <a class="w3-bar-item w3-button" href="/sql/sql_exercises.asp">SQL Exercises</a>
478 <a class="w3-bar-item w3-button" href="/php/php_exercises.asp">PHP Exercises</a>
479 <a class="w3-bar-item w3-button" href="/java/java_exercises.asp">Java Exercises</a>
480 <a class="w3-bar-item w3-button" href="/c/c_exercises.php">C Exercises</a>
481 <a class="w3-bar-item w3-button" href="/cpp/cpp_exercises.asp">C++ Exercises</a>
482 <a class="w3-bar-item w3-button" href="/cs/cs_exercises.asp">C# Exercises</a>
483 <a class="w3-bar-item w3-button" href="/jquery/jquery_exercises.asp">jQuery Exercises</a>
484 <a class="w3-bar-item w3-button" href="/react/react_exercises.asp">React.js Exercises</a>
485 <a class="w3-bar-item w3-button" href="/mysql/mysql_exercises.asp">MySQL Exercises</a>
486 <a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_exercises.php">Bootstrap 5 Exercises</a>
487 <a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_exercises.asp">Bootstrap 4 Exercises</a>
488 <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_exercises.asp">Bootstrap 3 Exercises</a>
489 <a class="w3-bar-item w3-button" href="/python/numpy/numpy_exercises.asp">NumPy Exercises</a>
490 <a class="w3-bar-item w3-button" href="/python/pandas/pandas_exercises.asp">Pandas Exercises</a>
491 <a class="w3-bar-item w3-button" href="/python/scipy/scipy_exercises.php">SciPy Exercises</a>
492 <a class="w3-bar-item w3-button" href="/typescript/typescript_exercises.php">TypeScript Exercises</a>
493 <a class="w3-bar-item w3-button" href="/excel/excel_exercises.php">Excel Exercises</a>
494 <a class="w3-bar-item w3-button" href="/r/r_exercises.asp">R Exercises</a>
495 <a class="w3-bar-item w3-button" href="/git/git_exercises.asp">Git Exercises</a>
496 <a class="w3-bar-item w3-button" href="/kotlin/kotlin_exercises.php">Kotlin Exercises</a>
497 <a class="w3-bar-item w3-button" href="/go/go_exercises.php">Go Exercises</a>
498 <a class="w3-bar-item w3-button" href="/mongodb/mongodb_exercises.php">MongoDB Exercises</a>
499 </div>
500 <div class="w3-col l3 m6">
501 <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><
502 <a class="w3-bar-item w3-button" href="/html/html_quiz.asp" target="_top">HTML Quiz</a>
503 <a class="w3-bar-item w3-button" href="/css/css_quiz.asp" target="_top">CSS Quiz</a>
504 <a class="w3-bar-item w3-button" href="/js/js_quiz.asp" target="_top">JavaScript Quiz</a>
505 <a class="w3-bar-item w3-button" href="/python/python_quiz.asp" target="_top">Python Quiz</a>
506 <a class="w3-bar-item w3-button" href="/sql/sql_quiz.asp" target="_top">SQL Quiz</a>
507 <a class="w3-bar-item w3-button" href="/php/php_quiz.asp" target="_top">PHP Quiz</a>
508 <a class="w3-bar-item w3-button" href="/java/java_quiz.asp" target="_top">Java Quiz</a>
509 <a class="w3-bar-item w3-button" href="/c/c_quiz.php">C Quiz</a>
510 <a class="w3-bar-item w3-button" href="/cpp/cpp_quiz.asp" target="_top">C++ Quiz</a>
511 <a class="w3-bar-item w3-button" href="/cs/cs_quiz.asp" target="_top">C# Quiz</a>
512 <a class="w3-bar-item w3-button" href="/jquery/jquery_quiz.asp" target="_top">jQuery Quiz</a>
513 <a class="w3-bar-item w3-button" href="/react/react_quiz.asp">React.js Quiz</a>
514 <a class="w3-bar-item w3-button" href="/mysql/mysql_quiz.asp" target="_top">MySQL Quiz</a>
515 <a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_quiz.php" target="_top">Bootstrap 5 Quiz</a>
516 <a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_quiz.asp" target="_top">Bootstrap 4 Quiz</a>
517 <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_quiz.asp" target="_top">Bootstrap 3 Quiz</a>
518 <a class="w3-bar-item w3-button" href="/python/numpy/numpy_quiz.asp" target="_top">NumPy Quiz</a>
519 <a class="w3-bar-item w3-button" href="/python/pandas/pandas_quiz.asp" target="_top">Pandas Quiz</a>
520 <a class="w3-bar-item w3-button" href="/python/scipy/scipy_quiz.php" target="_top">SciPy Quiz</a>
521 <a class="w3-bar-item w3-button" href="/typescript/typescript_quiz.php">TypeScript Quiz</a>
522 <a class="w3-bar-item w3-button" href="/xml/xml_quiz.asp" target="_top">XML Quiz</a>
523 <a class="w3-bar-item w3-button" href="/r/r_quiz.asp" target="_top">R Quiz</a>
524 <a class="w3-bar-item w3-button" href="/git/git_quiz.asp">Git Quiz</a>
525 <a class="w3-bar-item w3-button" href="/kotlin/kotlin_quiz.php" target="_top">Kotlin Quiz</a>
526 <a class="w3-bar-item w3-button" href="/cybersecurity/cybersecurity_quiz.php">Cyber Security Quiz</a>
527 <a class="w3-bar-item w3-button" href="/accessibility/accessibility_quiz.php">Accessibility Quiz</a>
528 </div>
529 <div class="w3-col l3 m6">
530 <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/collec
531 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/html-course" target="_blank">HTML Course</a>
532 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/css-course" target="_blank">CSS Course</a>
533 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/javascript-course" target="_blank">JavaScript
534 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/front-end-course" target="_blank">Front End Co
535 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/python-course" target="_blank">Python Course</
536 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/sql-course" target="_blank">SQL Course</a>
537 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/php-course" target="_blank">PHP Course</a>
538 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/java-course" target="_blank">Java Course</a>
539 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/c-course-1" target="_blank">C++ Course</a>
540 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/c-course" target="_blank">C# Course</a>
541 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/jquery-course" target="_blank">jQuery Course</
542 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/react-js-course" target="_blank">React.js Cour
543 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/bootstrap-4-course" target="_blank">Bootstrap
544 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/bootstrap-course" target="_blank">Bootstrap 3
545 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/numpy-course" target="_blank">NumPy Course</a>
546 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/pandas-course" target="_blank">Pandas Course</
547 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/learn-typescript" target="_blank">TypeScript C
548 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/xml-course" target="_blank">XML Course</a>
549 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/r-course" target="_blank">R Course</a>
550 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/data-analytics-program" target="_blank">Data A
551 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/cyber-security-course" target="_blank">Cyber S
552 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/course-catalog/products/accessibility-course" target="_blank">Accessib
553 </div>
554 <div class="w3-col l3 m6">
555 <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/collec
556 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/html-certificate" target="_blank">HTML Certifi
557 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/css-certificate" target="_blank">CSS Certifica
558 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/javascript-certificate" target="_blank">JavaSc
559 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/front-end-certificate" target="_blank">Front E
560 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/python-certificate" target="_blank">Python Cer
561 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/sql-certificate" target="_blank">SQL Certifica
562 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/php-certificate" target="_blank">PHP Certifica
563 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/java-certificate" target="_blank">Java Certifi
564 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/c-certificate" target="_blank">C++ Certificate
565 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/c-certificate-1" target="_blank">C# Certificat
566 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/jquery-certificate" target="_blank">jQuery Cer
567 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/react-js-certificate" target="_blank">React.js
568 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/mysql-certificate" target="_blank">MySQL Certi
569 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-5-certificate" target="_blank">Boots
570 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-4-certificate" target="_blank">Boots
571 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/bootstrap-3-certificate" target="_blank">Boots
572 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/typescript-certificate" target="_blank">TypeSc
573 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/xml-certificate" target="_blank">XML Certifica
574 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/excel-certificate" target="_blank">Excel Certi
575 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/data-science-certificate" target="_blank">Data
576 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/cyber-security-certificate" target="_blank">Cy
577 <a class="w3-bar-item w3-button" href="https://campus.w3schools.com/collections/certifications/products/accessibility-certificate" target="_blank">Acc
578 </div>
579 </div>
580 <br class="hidesm">
581 </div>
582 </nav>
583
584 </div>
585 </div>
586
587 <div id='myAccordion' class="w3-card-2 w3-center w3-hide-large w3-hide-medium ws-grey" style="width:100%;position:absolute;display:none;">
588 <a href="javascript:void(0)" onclick="w3_close()" class="w3-button w3-xxlarge w3-right">&times;</a><br>
589 <div class="w3-container w3-padding-32">
590 <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
591 <div id="sectionxs_tutorials" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
592 <a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('references')" href="javascript:void(0);">References <i class='fa fa-care
593 <div id="sectionxs_references" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
594 <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-
595 <div id="sectionxs_exercises" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div>
596 <a class="w3-button w3-block" style="font-size:22px;" href="https://campus.w3schools.com/collections/course-catalog" target="_blank">Get Certified</a
597 <a class="w3-button w3-block" style="font-size:22px;" href="/signup/index.html">Sign Up</a>
598 <a class="w3-button w3-block" style="font-size:22px;" href="/pro/index.php" title="Upgrade to Improve Your Learning Experiences">Upgrade</a>
599 <a class="w3-button w3-block" style="font-size:22px;" href="/spaces/index.html" title="Get Your Own Website With W3schools Spaces">Spaces</a>
600 <a class="w3-button w3-block" style="font-size:22px;" href="/bootcamp/index.php">Bootcamp</a>
601 <a class="w3-button w3-block" style="font-size:22px;" href="/videos/index.php" title="Video Tutorials">Videos</a>
602 <a class="w3-button w3-block" style="font-size:22px;" href="https://campus.w3schools.com" target="_blank">Shop</a>
603 </div>
604 </div>
605
606 <script>
607 (
608 function setThemeCheckboxes() {
609 var x = localStorage.getItem("preferredmode");
610 var y = localStorage.getItem("preferredpagemode");
611 if (x == "dark") {
612 document.getElementById("radio_darkcode").checked = true;
613
614 }
615 if (y == "dark") {
616 document.getElementById("radio_darkpage").checked = true;
617 }
618 })();
619
620 function mouseoverdarkicon() {
621 if(window.matchMedia("(pointer: coarse)").matches) {
622 return false;
623 }
624 var a = document.getElementById("darkmodemenu");
625 a.style.top = "44px";
626 }
627 function mouseoutofdarkicon() {
628 var a = document.getElementById("darkmodemenu");
629 a.style.top = "-40px";
630 }
631 function changepagetheme(n) {
632 var a = document.getElementById("radio_darkcode");
633 var b = document.getElementById("radio_darkpage");
634 document.body.className = document.body.className.replace("darktheme", "");
635 document.body.className = document.body.className.replace("darkpagetheme", "");
636 document.body.className = document.body.className.replace(" ", " ");
637 if (a.checked && b.checked) {
638 localStorage.setItem("preferredmode", "light");
639 localStorage.setItem("preferredpagemode", "light");
640 a.checked = false;
641 b.checked = false;
642 } else {
643 document.body.className += " darktheme";
644 document.body.className += " darkpagetheme";
645 localStorage.setItem("preferredmode", "dark");
646 localStorage.setItem("preferredpagemode", "dark");
647 a.checked = true;
648 b.checked = true;
649 }
650 }
651
652
653 function click_darkpage() {
654 var b = document.getElementById("radio_darkpage");
655 if (b.checked) {
656 document.body.className += " darkpagetheme";
657 document.body.className = document.body.className.replace(" ", " ");
658 localStorage.setItem("preferredpagemode", "dark");
659 } else {
660 document.body.className = document.body.className.replace("darkpagetheme", "");
661 document.body.className = document.body.className.replace(" ", " ");
662 localStorage.setItem("preferredpagemode", "light");
663 }
664 }
665
666 function click_darkcode() {
667 var a = document.getElementById("radio_darkcode");
668 if (a.checked) {
669 document.body.className += " darktheme";
670 document.body.className = document.body.className.replace(" ", " ");
671 localStorage.setItem("preferredmode", "dark");
672 } else {
673 document.body.className = document.body.className.replace("darktheme", "");
674 document.body.className = document.body.className.replace(" ", " ");
675 localStorage.setItem("preferredmode", "light");
676 }
677 }
678 </script>
679
680 <div class='w3-sidebar w3-collapse' id='sidenav'>
681 <div id='leftmenuinner'>
682 <div id='leftmenuinnerinner'>
683 <!-- <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
684 <h2 class="left">JS Tutorial</h2>
685 <a target="_top" href="default.asp">JS HOME</a>
686 <a target="_top" href="js_intro.asp">JS Introduction</a>
687 <a target="_top" href="js_whereto.asp">JS Where To</a>
688 <a target="_top" href="js_output.asp">JS Output</a>
689 <a target="_top" href="js_statements.asp">JS Statements</a>
690 <a target="_top" href="js_syntax.asp">JS Syntax</a>
691 <a target="_top" href="js_comments.asp">JS Comments</a>
692 <a target="_top" href="js_variables.asp">JS Variables</a>
693 <a target="_top" href="js_let.asp">JS Let</a>
694 <a target="_top" href="js_const.asp">JS Const</a>
695 <a target="_top" href="js_operators.asp">JS Operators</a>
696 <a target="_top" href="js_arithmetic.asp">JS Arithmetic</a>
697 <a target="_top" href="js_assignment.asp">JS Assignment</a>
698 <a target="_top" href="js_datatypes.asp">JS Data Types</a>
699 <a target="_top" href="js_functions.asp">JS Functions</a>
700 <a target="_top" href="js_objects.asp">JS Objects</a>
701 <a target="_top" href="js_events.asp">JS Events</a>
702 <a target="_top" href="js_strings.asp">JS Strings</a>
703 <a target="_top" href="js_string_methods.asp">JS String Methods</a>
704 <a target="_top" href="js_string_search.asp">JS String Search</a>
705 <a target="_top" href="js_string_templates.asp">JS String Templates</a>
706 <a target="_top" href="js_numbers.asp">JS Numbers</a>
707 <a target="_top" href="js_bigint.asp">JS BigInt</a>
708 <a target="_top" href="js_number_methods.asp">JS Number Methods</a>
709 <a target="_top" href="js_number_properties.asp">JS Number Properties</a>
710 <a target="_top" href="js_arrays.asp">JS Arrays</a>
711 <a target="_top" href="js_array_methods.asp">JS Array Methods</a>
712 <a target="_top" href="js_array_sort.asp">JS Array Sort</a>
713 <a target="_top" href="js_array_iteration.asp">JS Array Iteration</a>
714 <a target="_top" href="js_array_const.asp">JS Array Const</a>
715 <a target="_top" href="js_dates.asp">JS Dates</a>
716 <a target="_top" href="js_date_formats.asp">JS Date Formats</a>
717 <a target="_top" href="js_date_methods.asp">JS Date Get Methods</a>
718 <a target="_top" href="js_date_methods_set.asp">JS Date Set Methods</a>
719 <a target="_top" href="js_math.asp">JS Math</a>
720 <a target="_top" href="js_random.asp">JS Random</a>
721 <a target="_top" href="js_booleans.asp">JS Booleans</a>
722 <a target="_top" href="js_comparisons.asp">JS Comparisons</a>
723 <a target="_top" href="js_if_else.asp">JS If Else</a>
724 <a target="_top" href="js_switch.asp">JS Switch</a>
725 <a target="_top" href="js_loop_for.asp">JS Loop For</a>
726 <a target="_top" href="js_loop_forin.asp">JS Loop For In</a>
727 <a target="_top" href="js_loop_forof.asp">JS Loop For Of</a>
728 <a target="_top" href="js_loop_while.asp">JS Loop While</a>
729 <a target="_top" href="js_break.asp">JS Break</a>
730 <a target="_top" href="js_iterables.asp">JS Iterables</a>
731 <a target="_top" href="js_sets.asp">JS Sets</a>
732 <a target="_top" href="js_maps.asp">JS Maps</a>
733 <a target="_top" href="js_typeof.asp">JS Typeof</a>
734 <a target="_top" href="js_type_conversion.asp">JS Type Conversion</a>
735 <a target="_top" href="js_bitwise.asp">JS Bitwise</a>
736 <a target="_top" href="js_regexp.asp">JS RegExp</a>
737 <a target="_top" href="js_precedence.asp">JS Precedence</a>
738 <a target="_top" href="js_errors.asp">JS Errors</a>
739 <a target="_top" href="js_scope.asp">JS Scope</a>
740 <a target="_top" href="js_hoisting.asp">JS Hoisting</a>
741 <a target="_top" href="js_strict.asp">JS Strict Mode</a>
742 <a target="_top" href="js_this.asp">JS this Keyword</a>
743 <a target="_top" href="js_arrow_function.asp">JS Arrow Function</a>
744 <a target="_top" href="js_classes.asp">JS Classes</a>
745 <a target="_top" href="js_modules.asp">JS Modules</a>
746 <a target="_top" href="js_json.asp">JS JSON</a>
747 <a target="_top" href="js_debugging.asp">JS Debugging</a>
748 <a target="_top" href="js_conventions.asp">JS Style Guide</a>
749 <a target="_top" href="js_best_practices.asp">JS Best Practices</a>
750 <a target="_top" href="js_mistakes.asp">JS Mistakes</a>
751 <a target="_top" href="js_performance.asp">JS Performance</a>
752 <a target="_top" href="js_reserved.asp">JS Reserved Words</a>
753 <br>
754 <h2 class="left">JS Versions</h2>
755 <a target="_top" href="js_versions.asp">JS Versions</a>
756 <a target="_top" href="js_es5.asp">JS 2009 (ES5)</a>
757 <a target="_top" href="js_es6.asp">JS 2015 (ES6)</a>
758 <a target="_top" href="js_2016.asp">JS 2016</a>
759 <a target="_top" href="js_2017.asp">JS 2017</a>
760 <a target="_top" href="js_2018.asp">JS 2018</a>
761 <a target="_top" href="js_2019.asp">JS 2019</a>
762 <a target="_top" href="js_2020.asp">JS 2020</a>
763 <a target="_top" href="js_2021.asp">JS 2021/2022</a>
764 <a target="_top" href="js_ie_edge.asp">JS IE / Edge</a>
765 <a target="_top" href="js_history.asp">JS History</a>
766 <br>
767 <h2 class="left">JS Objects</h2>
768 <a target="_top" href="js_object_definition.asp">Object Definitions</a>
769 <a target="_top" href="js_object_properties.asp">Object Properties</a>
770 <a target="_top" href="js_object_methods.asp">Object Methods</a>
771 <a target="_top" href="js_object_display.asp">Object Display</a>
772 <a target="_top" href="js_object_accessors.asp">Object Accessors</a>
773 <a target="_top" href="js_object_constructors.asp">Object Constructors</a>
774 <a target="_top" href="js_object_prototypes.asp">Object Prototypes</a>
775 <a target="_top" href="js_object_iterables.asp">Object Iterables</a>
776 <a target="_top" href="js_object_sets.asp">Object Sets</a>
777 <a target="_top" href="js_object_maps.asp">Object Maps</a>
778 <a target="_top" href="js_object_es5.asp">Object Reference</a>
779 <br>
780 <h2 class="left">JS Functions</h2>
781 <a target="_top" href="js_function_definition.asp">Function Definitions</a>
782 <a target="_top" href="js_function_parameters.asp">Function Parameters</a>
783 <a target="_top" href="js_function_invocation.asp">Function Invocation</a>
784 <a target="_top" href="js_function_call.asp">Function Call</a>
785 <a target="_top" href="js_function_apply.asp">Function Apply</a>
786 <a target="_top" href="js_function_bind.asp">Function Bind</a>
787 <a target="_top" href="js_function_closures.asp">Function Closures</a>
788 <br>
789 <h2 class="left">JS Classes</h2>
790 <a target="_top" href="js_class_intro.asp">Class Intro</a>
791 <a target="_top" href="js_class_inheritance.asp">Class Inheritance</a>
792 <a target="_top" href="js_class_static.asp">Class Static</a>
793 <br>
794 <h2 class="left">JS Async</h2>
795 <a target="_top" href="js_callback.asp">JS Callbacks</a>
796 <a target="_top" href="js_asynchronous.asp">JS Asynchronous</a>
797 <a target="_top" href="js_promise.asp">JS Promises</a>
798 <a target="_top" href="js_async.asp">JS Async/Await</a>
799 <br>
800 <h2 class="left">JS HTML DOM</h2>
801 <a target="_top" href="js_htmldom.asp">DOM Intro</a>
802 <a target="_top" href="js_htmldom_methods.asp">DOM Methods</a>
803 <a target="_top" href="js_htmldom_document.asp">DOM Document</a>
804 <a target="_top" href="js_htmldom_elements.asp">DOM Elements</a>
805 <a target="_top" href="js_htmldom_html.asp">DOM HTML</a>
806 <a target="_top" href="js_validation.asp">DOM Forms</a>
807 <a target="_top" href="js_htmldom_css.asp">DOM CSS</a>
808 <a target="_top" href="js_htmldom_animate.asp">DOM Animations</a>
809 <a target="_top" href="js_htmldom_events.asp">DOM Events</a>
810 <a target="_top" href="js_htmldom_eventlistener.asp">DOM Event Listener</a>
811 <a target="_top" href="js_htmldom_navigation.asp">DOM Navigation</a>
812 <a target="_top" href="js_htmldom_nodes.asp">DOM Nodes</a>
813 <a target="_top" href="js_htmldom_collections.asp">DOM Collections</a>
814 <a target="_top" href="js_htmldom_nodelist.asp">DOM Node Lists</a>
815 <br>
816 <h2 class="left">JS Browser BOM</h2>
817 <a target="_top" href="js_window.asp">JS Window</a>
818 <a target="_top" href="js_window_screen.asp">JS Screen</a>
819 <a target="_top" href="js_window_location.asp">JS Location</a>
820 <a target="_top" href="js_window_history.asp">JS History</a>
821 <a target="_top" href="js_window_navigator.asp">JS Navigator</a>
822 <a target="_top" href="js_popup.asp">JS Popup Alert</a>
823 <a target="_top" href="js_timing.asp">JS Timing</a>
824 <a target="_top" href="js_cookies.asp">JS Cookies</a>
825 <br>
826 <h2 class="left">JS Web APIs</h2>
827 <a target="_top" href="js_api_intro.asp">Web API Intro</a>
828 <a target="_top" href="js_validation_api.asp">Web Forms API</a>
829 <a target="_top" href="js_api_history.asp">Web History API</a>
830 <a target="_top" href="js_api_web_storage.asp">Web Storage API</a>
831 <a target="_top" href="js_api_web_workers.asp">Web Worker API</a>
832 <a target="_top" href="js_api_fetch.asp">Web Fetch API</a>
833 <a target="_top" href="js_api_geolocation.asp">Web Geolocation API</a>
834 <br>
835 <h2 class="left">JS AJAX</h2>
836 <a target="_top" href="js_ajax_intro.asp">AJAX Intro</a>
837 <a target="_top" href="js_ajax_http.asp">AJAX XMLHttp</a>
838 <a target="_top" href="js_ajax_http_send.asp">AJAX Request</a>
839 <a target="_top" href="js_ajax_http_response.asp">AJAX Response</a>
840 <a target="_top" href="js_ajax_xmlfile.asp">AJAX XML File</a>
841 <a target="_top" href="js_ajax_php.asp">AJAX PHP</a>
842 <a target="_top" href="js_ajax_asp.asp">AJAX ASP</a>
843 <a target="_top" href="js_ajax_database.asp">AJAX Database</a>
844 <a target="_top" href="js_ajax_applications.asp">AJAX Applications</a>
845 <a target="_top" href="js_ajax_examples.asp">AJAX Examples</a>
846 <br>
847 <h2 class="left">JS JSON</h2>
848 <a target="_top" href="js_json_intro.asp">JSON Intro</a>
849 <a target="_top" href="js_json_syntax.asp">JSON Syntax</a>
850 <a target="_top" href="js_json_xml.asp">JSON vs XML</a>
851 <a target="_top" href="js_json_datatypes.asp">JSON Data Types</a>
852 <a target="_top" href="js_json_parse.asp">JSON Parse</a>
853 <a target="_top" href="js_json_stringify.asp">JSON Stringify</a>
854 <a target="_top" href="js_json_objects.asp">JSON Objects</a>
855 <a target="_top" href="js_json_arrays.asp">JSON Arrays</a>
856 <a target="_top" href="js_json_server.asp">JSON Server</a>
857 <a target="_top" href="js_json_php.asp">JSON PHP</a>
858 <a target="_top" href="js_json_html.asp">JSON HTML</a>
859 <a target="_top" href="js_json_jsonp.asp">JSON JSONP</a>
860 <br>
861 <h2 class="left">JS vs jQuery</h2>
862 <a target="_top" href="js_jquery_selectors.asp">jQuery Selectors</a>
863 <a target="_top" href="js_jquery_elements.asp">jQuery HTML</a>
864 <a target="_top" href="js_jquery_css.asp">jQuery CSS</a>
865 <a target="_top" href="js_jquery_dom.asp">jQuery DOM</a>
866 <br>
867 <h2 class="left">JS Graphics</h2>
868 <a target="_top" href="js_graphics.asp">JS Graphics</a>
869 <a target="_top" href="js_graphics_canvas.asp">JS Canvas</a>
870 <a target="_top" href="js_graphics_plotly.asp">JS Plotly</a>
871 <a target="_top" href="js_graphics_chartjs.asp">JS Chart.js</a>
872 <a target="_top" href="js_graphics_google_chart.asp">JS Google Chart</a>
873 <a target="_top" href="js_graphics_d3js.asp">JS D3.js</a>
874 <br>
875 <h2 class="left">JS Examples</h2>
876 <a target="_top" href="js_examples.asp">JS Examples</a>
877 <a target="_top" href="js_dom_examples.asp">JS HTML DOM</a>
878 <a target="_top" href="js_input_examples.asp">JS HTML Input</a>
879 <a target="_top" href="js_ex_dom.asp">JS HTML Objects</a>
880 <a target="_top" href="js_events_examples.asp">JS HTML Events</a>
881 <a target="_top" href="js_ex_browser.asp">JS Browser</a>
882 <a target="_top" href="js_editor.asp">JS Editor</a>
883 <a target="_top" href="js_exercises.asp">JS Exercises</a>
884 <a target="_top" href="js_quiz.asp">JS Quiz</a>
885 <a target="_top" href="js_exam.asp">JS Certificate</a>
886 <br>
887 <h2 class="left">JS References</h2>
888 <a target="_top" href="/jsref/default.asp">JavaScript Objects</a>
889 <a target="_top" href="/jsref/default.asp">HTML DOM Objects</a>
890 <br>
891 <br><br>
892 </div>
893 </div>
894 </div>
895 <div class='w3-main w3-light-grey' id='belowtopnav' style='margin-left:220px;'>
896 <div class='w3-row w3-white'>
897 <div class='w3-col l10 m12' id='main'>
898 <div id='mainLeaderboard' style='overflow:hidden;'>
899 <!-- MainLeaderboard-->
900
901 <!--<pre>main_leaderboard, all: [728,90][970,90][320,50][468,60]</pre>-->
902 <div id="adngin-main_leaderboard-0"></div>
903 <!-- adspace leaderboard -->
904
905 </div>
906 <h1>JavaScript <span class="color_h1">Statements</span></h1>
907 <div class="w3-clear nextprev">
908 <a class="w3-left w3-btn" href="js_output.asp">&#10094; Previous</a>
909 <a class="w3-right w3-btn" href="js_syntax.asp">Next &#10095;</a>
910 </div>
911 <hr>
912 <div class="w3-example">
913 <h3>Example</h3>
914 <div class="w3-code notranslate jsHigh">
915 let x, y, z;&nbsp;&nbsp;&nbsp; // Statement 1<br>
916 x = 5;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Statement 2<br>
917 y = 6;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Statement 3<br>
918 z = x + y;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Statement 4<br>
919 </div>
920 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statements" target="_blank">Try it Yourself &raquo;</a>
921 </div>
922
923 <hr>
924 <h2>JavaScript Programs</h2>
925 <p>A <strong>computer program</strong> is a list of &quot;instructions&quot; to be
926 &quot;executed&quot; by a computer.</p>
927 <p>In a programming language, these programming instructions are called <strong>statements</strong>.</p>
928 <p>A <strong>JavaScript program</strong> is a list of programming <strong>statements</strong>.</p>
929
930 <div class="w3-panel w3-note">
931 <p>In HTML, JavaScript programs are executed by the web browser.</p>
932 </div>
933
934 <hr>
935
936 <h2>JavaScript Statements</h2>
937 <p>JavaScript statements are composed of:</p>
938 <p>Values, Operators, Expressions,&nbsp;Keywords,
939 and Comments.</p>
940 <p>This statement tells the browser to write &quot;Hello Dolly.&quot;
941 inside an HTML element with id=&quot;demo&quot;:</p>
942 <div class="w3-example">
943 <h3>Example</h3>
944 <div class="w3-code notranslate jsHigh">
945 document.getElementById(&quot;demo&quot;).innerHTML = &quot;Hello Dolly.&quot;;</div>
946 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statement" target="_blank">Try it Yourself &raquo;</a>
947 </div>
948
949 <p>Most JavaScript
950 programs contain many JavaScript statements.</p>
951 <p>The statements are executed, one by one, in the
952 same order as they are written.</p>
953
954 <div class="w3-panel w3-note">
955 <p>JavaScript programs (and JavaScript statements) are often called JavaScript code.
956 </p>
957 </div>
958
959 <hr>
960 <h2>Semicolons ;</h2>
961 <p>Semicolons separate JavaScript statements.</p>
962 <p>Add a semicolon at the end of each executable statement: </p>
963 <div class="w3-example">
964 <h3>Examples</h3>
965 <div class="w3-code notranslate jsHigh">
966 let a, b, c;&nbsp; // Declare 3 variables<br>
967 a = 5;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Assign the value 5 to a<br>
968 b = 6;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Assign the
969 value 6 to b<br>
970 c = a + b;&nbsp;&nbsp;&nbsp; // Assign the sum of a and b to c<br>
971 </div>
972 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statements_semicolon1" target="_blank">Try it Yourself &raquo;</a>
973 </div>
974 <p>
975 When separated by semicolons, multiple statements on one line are allowed:</p>
976 <div class="w3-example">
977 <div class="w3-code notranslate jsHigh">
978 a = 5; b = 6; c = a + b;
979 </div>
980 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statements_semicolon2" target="_blank">Try it Yourself &raquo;</a>
981 </div>
982
983 <div class="w3-panel w3-note">
984 <p>On the web, you might see examples without semicolons. <br>
985 Ending statements with semicolon is not required, but highly recommended.</p>
986 </div>
987
988 <hr>
989 <div id="midcontentadcontainer" style="overflow:auto;text-align:center">
990 <!-- MidContent -->
991 <!-- <p class="adtext">Advertisement</p> -->
992
993 <div id="adngin-mid_content-0"></div>
994
995 </div>
996 <hr>
997 <h2>JavaScript White Space</h2>
998 <p>JavaScript ignores multiple spaces. You can add white space to your script to make it more readable.</p>
999 <p>The following lines are equivalent:</p>
1000
1001 <div class="w3-example">
1002 <div class="w3-code notranslate jsHigh">
1003 let person = &quot;Hege&quot;;<br>
1004 let person=&quot;Hege&quot;;
1005 </div>
1006 </div>
1007 <p>A good practice is to put spaces around operators ( = + - * / ):</p>
1008
1009 <div class="w3-example">
1010 <div class="w3-code notranslate jsHigh">
1011 let x = y + z;</div>
1012 </div>
1013 <hr>
1014
1015 <h2>JavaScript Line Length and Line Breaks</h2>
1016 <p>For best readability, programmers often like to avoid code lines longer than 80
1017 characters.</p>
1018 <p>If a JavaScript statement does not fit on one line, the best place to break
1019 it is after an operator:</p>
1020 <div class="w3-example">
1021 <h3>Example</h3>
1022 <div class="w3-code notranslate jsHigh">
1023 document.getElementById(&quot;demo&quot;).innerHTML =<br>&quot;Hello Dolly!&quot;;</div>
1024 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statements_linebreak" target="_blank">Try it Yourself &raquo;</a>
1025 </div>
1026 <hr>
1027
1028 <h2>JavaScript Code Blocks</h2>
1029 <p>JavaScript statements can be grouped together in code blocks, inside curly
1030 brackets {...}.</p>
1031 <p>The purpose of code blocks is to define statements to be executed together.</p>
1032 <p>One place you will find statements grouped together in blocks, is in
1033 JavaScript functions:</p>
1034
1035 <div class="w3-example">
1036 <h3>Example</h3>
1037 <div class="w3-code notranslate jsHigh">
1038 function myFunction() {<br>
1039 &nbsp;&nbsp;document.getElementById(&quot;demo1&quot;).innerHTML = &quot;Hello Dolly!&quot;;<br>
1040 &nbsp;&nbsp;document.getElementById(&quot;demo2&quot;).innerHTML = &quot;How are you?&quot;;<br>
1041 }<br>
1042 </div>
1043 <a class="w3-btn w3-margin-bottom" href="tryit.asp?filename=tryjs_statements_blocks" target="_blank">Try it Yourself &raquo;</a>
1044 </div>
1045
1046 <div class="w3-panel w3-note">
1047 <p>In this tutorial we use 2 spaces of indentation for code blocks.<br>
1048 You will learn more about functions later in this tutorial.</p>
1049 </div>
1050
1051 <hr>
1052 <h2>JavaScript Keywords</h2>
1053 <p>JavaScript statements often start with a <strong>keyword</strong>
1054 to identify the JavaScript action to be performed.</p>
1055 <p>Our <a href="js_reserved.asp">Reserved Words Reference</a> lists all JavaScript keywords.</p>
1056 <p>Here is a list of some of the keywords you will learn about in
1057 this tutorial: </p>
1058 <table class="ws-table-all" style="width: 100%">
1059 <tr>
1060 <th style="height: 25px">Keyword</th>
1061 <th style="height: 25px">Description</th>
1062 </tr>
1063
1064 <tr>
1065 <td class="notranslate">var</td>
1066 <td>Declares a variable</td>
1067 </tr>
1068 <tr>
1069 <td class="notranslate">let</td>
1070 <td>Declares a block variable</td>
1071 </tr>
1072 <tr>
1073 <td class="notranslate">const</td>
1074 <td>Declares a block constant</td>
1075 </tr>
1076 <tr>
1077 <td class="notranslate">if</td>
1078 <td>Marks a block of statements to be executed on a condition</td>
1079 </tr>
1080 <tr>
1081 <td class="notranslate">switch</td>
1082 <td>Marks a block of statements to be executed in different cases</td>
1083 </tr>
1084 <tr>
1085 <td class="notranslate">for</td>
1086 <td>Marks a block of statements to be executed in a loop</td>
1087 </tr>
1088 <tr>
1089 <td class="notranslate">function</td>
1090 <td>Declares a function</td>
1091 </tr>
1092 <tr>
1093 <td class="notranslate">return</td>
1094 <td>Exits a function</td>
1095 </tr>
1096 <tr>
1097 <td class="notranslate">try</td>
1098 <td>Implements error handling to a block of statements</td>
1099 </tr>
1100 </table>
1101
1102 <div class="w3-panel w3-note">
1103 <p>JavaScript keywords are reserved words. Reserved words cannot be used as names for variables.</p>
1104 </div>
1105
1106 <br>
1107 <div class="w3-clear nextprev">
1108 <a class="w3-left w3-btn" href="js_output.asp">&#10094; Previous</a>
1109 <a class="w3-right w3-btn" href="js_syntax.asp">Next &#10095;</a>
1110 </div>
1111 <div id="mypagediv2" style="position:relative;text-align:center;"></div>
1112 <br>
1113
1114 </div>
1115 <div class="w3-col l2 m12" id="right">
1116
1117 <div class="sidesection">
1118 <div id="skyscraper">
1119
1120 <div id="adngin-sidebar_top-0"></div>
1121
1122 </div>
1123 </div>
1124
1125 <style>
1126 .ribbon-vid {
1127 font-size:12px;
1128 font-weight:bold;
1129 padding: 6px 20px;
1130 left:-20px;
1131 top:-10px;
1132 text-align: center;
1133 color:black;
1134 border-radius:25px;
1135 }
1136 </style>
1137
1138 <div class="sidesection" style="margin-top:20px;margin-bottom:20px;">
1139 <a id="upperfeatureshowcaselink" class="showcasebackend" href="https://www.w3schools.com/spaces/" target="_blank">
1140 <picture id="upperfeatureshowcase">
1141 <source id="upperfeatureshowcase3001" srcset="/images/img_backend_300.png" media="(max-width: 990px)" style="border-radius: 5px;">
1142 <source id="upperfeatureshowcase120" srcset="/images/img_backend_120.png" media="(max-width: 1260px)" style="border-radius: 5px;">
1143 <source id="upperfeatureshowcase160" srcset="/images/img_backend_160.png" media="(max-width: 1700px)" style="border-radius: 5px;">
1144 <img id="upperfeatureshowcase300" src="/images/img_backend_300.png" alt="Get started with your own server with Dynamic Spaces" style="width:auto;border
1145 </picture>
1146 </a>
1147 </div>
1148
1149 <div class="sidesection">
1150 <h4><a href="/colors/colors_picker.asp">COLOR PICKER</a></h4>
1151 <a href="/colors/colors_picker.asp">
1152 <img src="/images/colorpicker2000.png" alt="colorpicker" loading="lazy">
1153 </a>
1154 </div>
1155
1156 <div class="sidesection">
1157 <!--<h4>LIKE US</h4>-->
1158 <div class="sharethis">
1159 <a href="https://www.facebook.com/w3schoolscom/" target="_blank" title="Facebook"><span class="fa fa-facebook-square fa-2x"></span></a>
1160 <a href="https://www.instagram.com/w3schools.com_official/" target="_blank" title="Instagram"><span class="fa fa-instagram fa-2x"></span></a>
1161 <a href="https://www.linkedin.com/company/w3schools.com/" target="_blank" title="LinkedIn"><span class="fa fa-linkedin-square fa-2x"></span></a>
1162 <a href="https://discord.gg/6Z7UaRbUQM" target="_blank" title='Join the W3schools community on Discord'><span class="fa fa-discord fa-2x"></span></a>
1163 </div>
1164 </div>
1165
1166 <!--
1167 <div class="sidesection" style="border-radius:5px;color:#555;padding-top:1px;padding-bottom:8px;margin-left:auto;margin-right:auto;max-width:230px;backgr
1168 <p>Get your<br>certification today!</p>
1169 <a href="/cert/default.asp" target="_blank">
1170 <img src="/images/w3certified_logo_250.png" style="margin:0 12px 20px 10px;max-width:80%">
1171 </a>
1172 <a class="w3-btn w3-margin-bottom" style="text-decoration:none;border-radius:5px;"
1173 href="/cert/default.asp" target="_blank">View options</a>
1174 </div>
1175 -->
1176
1177 <style>
1178 #courses_get_started_btn {
1179 text-decoration:none !important;
1180 background-color:#04AA6D;
1181 width:100%;
1182 border-bottom-left-radius:5px;
1183 border-bottom-right-radius:5px;
1184 padding-top:10px;
1185 padding-bottom:10px;
1186 font-family: 'Source Sans Pro', sans-serif;
1187 }
1188 #courses_get_started_btn:hover {
1189 background-color:#059862!important;
1190 }
1191 </style>
1192 <div id="internalCourses" class="sidesection">
1193 <p style="font-size:18px;padding-left:2px;padding-right:2px;">Get certified<br>by completing<br><span id="courses_subject_text">a</span> course today!</p
1194 <a id="courses_subject_img_link" href="https://shop.w3schools.com/collections/course-catalog" target="_blank">
1195 <div style="padding:0 20px 20px 20px">
1196 <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>.
1197 </div>
1198
1199 </a>
1200 <a class="w3-btn" id="courses_get_started_btn"
1201 href="https://shop.w3schools.com/collections/course-catalog" target="_blank">Get started</a>
1202 </div>
1203
1204 <div class="sidesection" id="moreAboutSubject">
1205 </div>
1206
1207 <div class="sidesection" style="margin-top:20px;margin-bottom:20px;">
1208 <a id="lowerfeatureshowcaselink" class="showcasesubs" href="https://www.w3schools.com/spaces/" target="_blank">
1209 <picture id="lowerfeatureshowcase">
1210 <source id="lowerfeatureshowcase3001" srcset="/images/img_subs_300.png" media="(max-width: 990px)" style="border-radius: 5px;">
1211 <source id="lowerfeatureshowcase120" srcset="/images/img_subs_120.png" media="(max-width: 1260px)" style="border-radius: 5px;">
1212 <source id="lowerfeatureshowcase160" srcset="/images/img_subs_160.png" media="(max-width: 1700px)" style="border-radius: 5px;">
1213 <img id="lowerfeatureshowcase300" src="/images/img_subs_300.png" alt="Subscribe" style="width:auto;border-radius: 5px;">
1214 </picture>
1215 </a>
1216 </div>
1217
1218 <script>
1219 var internalFeatureRnd = Math.floor(Math.random() * (5 - 1)) + 1;
1220 var upshowcase120 = document.getElementById("upperfeatureshowcase120");
1221 var upshowcase160 = document.getElementById("upperfeatureshowcase160");
1222 var upshowcase300 = document.getElementById("upperfeatureshowcase300");
1223 var upshowcase3001 = document.getElementById("upperfeatureshowcase3001");
1224 var upshowcaselink = document.getElementById("upperfeatureshowcaselink");
1225 var lowshowcase120 = document.getElementById("lowerfeatureshowcase120");
1226 var lowshowcase160 = document.getElementById("lowerfeatureshowcase160");
1227 var lowshowcase300 = document.getElementById("lowerfeatureshowcase300");
1228 var lowshowcase3001 = document.getElementById("lowerfeatureshowcase3001");
1229 var lowshowcaselink = document.getElementById("lowerfeatureshowcaselink");
1230
1231 if (internalFeatureRnd == 2) {
1232 upshowcase120.srcset = "/images/img_subs_120.png";
1233 upshowcase160.srcset = "/images/img_subs_160.png";
1234 upshowcase300.srcset = "/images/img_subs_300.png";
1235 upshowcase3001.srcset = "/images/img_subs_300.png";
1236 upshowcaselink.href = "https://www.w3schools.com/spaces/";
1237 upshowcaselink.classList.remove("showcasebackend");
1238 upshowcaselink.classList.add("showcaseupgrade");
1239 lowshowcase120.srcset = "/images/img_bootcamp_120.png";
1240 lowshowcase160.srcset = "/images/img_bootcamp_160.png";
1241 lowshowcase300.srcset = "/images/img_bootcamp_300.png";
1242 lowshowcase3001.srcset = "/images/img_bootcamp_300.png";
1243 lowshowcaselink.href = "https://www.w3schools.com/bootcamp/";
1244 lowshowcaselink.classList.remove("showcasesubs");
1245 lowshowcaselink.classList.add("showcasebootcamp");
1246 } else if (internalFeatureRnd == 3) {
1247 upshowcase120.srcset = "/images/img_bootcamp_120.png";
1248 upshowcase160.srcset = "/images/img_bootcamp_160.png";
1249 upshowcase300.srcset = "/images/img_bootcamp_300.png";
1250 upshowcase3001.srcset = "/images/img_bootcamp_300.png";
1251 upshowcaselink.href = "https://www.w3schools.com/bootcamp/";
1252 upshowcaselink.classList.remove("showcasebackend");
1253 upshowcaselink.classList.add("showcasebootcamp");
1254 lowshowcase120.srcset = "/images/img_fullaccess3_120.png";
1255 lowshowcase160.srcset = "/images/img_fullaccess3_160.png";
1256 lowshowcase300.srcset = "/images/img_fullaccess3_300.png";
1257 lowshowcase3001.srcset = "/images/img_fullaccess3_300.png";
1258 lowshowcaselink.href = "https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-access-course";
1259 lowshowcaselink.classList.remove("showcasesubs");
1260 lowshowcaselink.classList.add("showcasefullaccess");
1261 } else if (internalFeatureRnd == 4) {
1262 upshowcase120.srcset = "/images/img_fullaccess3_120.png";
1263 upshowcase160.srcset = "/images/img_fullaccess3_160.png";
1264 upshowcase300.srcset = "/images/img_fullaccess3_300.png";
1265 upshowcase3001.srcset = "/images/img_fullaccess3_300.png";
1266 upshowcaselink.href = "https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-access-course";
1267 upshowcaselink.classList.remove("showcasebackend");
1268 upshowcaselink.classList.add("showcasefullaccess");
1269 lowshowcase120.srcset = "/images/img_backend_120.png";
1270 lowshowcase160.srcset = "/images/img_backend_160.png";
1271 lowshowcase300.srcset = "/images/img_backend_300.png";
1272 lowshowcase3001.srcset = "/images/img_backend_300.png";
1273 lowshowcaselink.href = "https://www.w3schools.com/spaces/";
1274 lowshowcaselink.classList.remove("showcasesubs");
1275 lowshowcaselink.classList.add("showcasebackend");
1276 }
1277 function addTryitSpaces(subject) {
1278 let spacesButt = document.createElement("a");
1279 let ribb = document.createElement("span");
1280 spacesButt.innerHTML="Get your own " + subject + " Server"
1281 spacesButt.classList.add("ws-black", "ws-hover-black", "spaces-tryit");
1282 spacesButt.href="https://www.w3schools.com/spaces/";
1283 spacesButt.setAttribute("title", "W3Schools Spaces");
1284 spacesButt.setAttribute("target", "_blank");
1285
1286 var tryits = document.getElementsByClassName("w3-example");
1287 for (var i = 0; i < tryits.length; i++) {
1288 if (tryits[i].firstElementChild.nodeName == "H3") {
1289 tryits[i].firstElementChild.appendChild(spacesButt.cloneNode(true));
1290 break;
1291 }
1292 }
1293 }
1294
1295 switch (subjectFolder) {
1296 case "cpp":
1297 subjectText = "C++";
1298 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/c-course-1";
1299 break;
1300 case "java":
1301 subjectText = "Java";
1302 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/java-course";
1303 addTryitSpaces(subjectText);
1304 break;
1305 case "bootstrap4":
1306 subjectText = "Bootstrap 4";
1307 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/bootstrap-4-course";
1308 break;
1309 case "xml":
1310 subjectText = "XML";
1311 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/xml-course";
1312 break;
1313 case "jquery":
1314 subjectText = "jQuery";
1315 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/jquery-course";
1316 break;
1317 case "accessibility":
1318 subjectText = "Accessibility";
1319 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/accessibility-course";
1320 break;
1321 case "bootstrap":
1322 subjectText = "Bootstrap 3";
1323 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/bootstrap-course";
1324 break;
1325 case "html":
1326 subjectText = "HTML";
1327 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/html-course";
1328 break;
1329 case "tags":
1330 subjectText = "HTML";
1331 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/html-course";
1332 break;
1333 case "css":
1334 subjectText = "CSS";
1335 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/css-course";
1336 break;
1337 case "cssref":
1338 subjectText = "CSS";
1339 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/css-course";
1340 break;
1341 case "js":
1342 subjectText = "JavaScript";
1343 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/javascript-course";
1344 break;
1345 case "jsref":
1346 subjectText = "JavaScript";
1347 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/javascript-course";
1348 break;
1349 case "react":
1350 subjectText = "React.js";
1351 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/react-js-course";
1352 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1353 upshowcase120.srcset = "/images/img_backend_120_react.png";
1354 upshowcase160.srcset = "/images/img_backend_160_react.png";
1355 upshowcase300.srcset = "/images/img_backend_300_react.png";
1356 upshowcase3001.srcset = "/images/img_backend_300_react.png";
1357 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1358 lowshowcase120.srcset = "/images/img_backend_120_react.png";
1359 lowshowcase160.srcset = "/images/img_backend_160_react.png";
1360 lowshowcase300.srcset = "/images/img_backend_300_react.png";
1361 lowshowcase3001.srcset = "/images/img_backend_300_react.png";
1362 }
1363 addTryitSpaces(subjectText);
1364 break;
1365 case "sql":
1366 subjectText = "SQL";
1367 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/sql-course";
1368 addTryitSpaces(subjectText);
1369 break;
1370 case "mysql":
1371 addTryitSpaces("SQL");
1372 break;
1373 case "php":
1374 subjectText = "PHP";
1375 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/php-course";
1376 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1377 upshowcase120.srcset = "/images/img_backend_120_php.png";
1378 upshowcase160.srcset = "/images/img_backend_160_php.png";
1379 upshowcase300.srcset = "/images/img_backend_300_php.png";
1380 upshowcase3001.srcset = "/images/img_backend_300_php.png";
1381 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1382 lowshowcase120.srcset = "/images/img_backend_120_php.png";
1383 lowshowcase160.srcset = "/images/img_backend_160_php.png";
1384 lowshowcase300.srcset = "/images/img_backend_300_php.png";
1385 lowshowcase3001.srcset = "/images/img_backend_300_php.png";
1386 }
1387 addTryitSpaces(subjectText);
1388 break;
1389 case "cybersecurity":
1390 subjectText = "Cyber Security";
1391 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/cyber-security-course";
1392 break;
1393 case "r":
1394 subjectText = "R";
1395 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/r-course";
1396 break;
1397 case "numpy":
1398 subjectText = "Numpy";
1399 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/numpy-course";
1400 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1401 upshowcase120.srcset = "/images/img_backend_120_numpy.png";
1402 upshowcase160.srcset = "/images/img_backend_160_numpy.png";
1403 upshowcase300.srcset = "/images/img_backend_300_numpy.png";
1404 upshowcase3001.srcset = "/images/img_backend_300_numpy.png";
1405 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1406 lowshowcase120.srcset = "/images/img_backend_120_numpy.png";
1407 lowshowcase160.srcset = "/images/img_backend_160_numpy.png";
1408 lowshowcase300.srcset = "/images/img_backend_300_numpy.png";
1409 lowshowcase3001.srcset = "/images/img_backend_300_numpy.png";
1410 }
1411 addTryitSpaces("Python");
1412 break;
1413 case "django":
1414 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1415 upshowcase120.srcset = "/images/img_backend_120_django.png";
1416 upshowcase160.srcset = "/images/img_backend_160_django.png";
1417 upshowcase300.srcset = "/images/img_backend_300_django.png";
1418 upshowcase3001.srcset = "/images/img_backend_300_django.png";
1419 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1420 lowshowcase120.srcset = "/images/img_backend_120_django.png";
1421 lowshowcase160.srcset = "/images/img_backend_160_django.png";
1422 lowshowcase300.srcset = "/images/img_backend_300_django.png";
1423 lowshowcase3001.srcset = "/images/img_backend_300_django.png";
1424 }
1425 addTryitSpaces("Django");
1426 break;
1427 case "typescript":
1428 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1429 upshowcase120.srcset = "/images/img_backend_120_ts.png";
1430 upshowcase160.srcset = "/images/img_backend_160_ts.png";
1431 upshowcase300.srcset = "/images/img_backend_300_ts.png";
1432 upshowcase3001.srcset = "/images/img_backend_300_ts.png";
1433 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1434 lowshowcase120.srcset = "/images/img_backend_120_ts.png";
1435 lowshowcase160.srcset = "/images/img_backend_160_ts.png";
1436 lowshowcase300.srcset = "/images/img_backend_300_ts.png";
1437 lowshowcase3001.srcset = "/images/img_backend_300_ts.png";
1438 }
1439 addTryitSpaces("TypeScript");
1440 break;
1441 case "nodejs":
1442 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1443 upshowcase120.srcset = "/images/img_backend_120_node.png";
1444 upshowcase160.srcset = "/images/img_backend_160_node.png";
1445 upshowcase300.srcset = "/images/img_backend_300_node.png";
1446 upshowcase3001.srcset = "/images/img_backend_300_node.png";
1447 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1448 lowshowcase120.srcset = "/images/img_backend_120_node.png";
1449 lowshowcase160.srcset = "/images/img_backend_160_node.png";
1450 lowshowcase300.srcset = "/images/img_backend_300_node.png";
1451 lowshowcase3001.srcset = "/images/img_backend_300_node.png";
1452 }
1453 addTryitSpaces("Node.js");
1454 break;
1455 case "pandas":
1456 subjectText = "Pandas";
1457 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/pandas-course";
1458 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1459 upshowcase120.srcset = "/images/img_backend_120_pandas.png";
1460 upshowcase160.srcset = "/images/img_backend_160_pandas.png";
1461 upshowcase300.srcset = "/images/img_backend_300_pandas.png";
1462 upshowcase3001.srcset = "/images/img_backend_300_pandas.png";
1463 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1464 lowshowcase120.srcset = "/images/img_backend_120_pandas.png";
1465 lowshowcase160.srcset = "/images/img_backend_160_pandas.png";
1466 lowshowcase300.srcset = "/images/img_backend_300_pandas.png";
1467 lowshowcase3001.srcset = "/images/img_backend_300_pandas.png";
1468 }
1469 addTryitSpaces("Python");
1470 break;
1471 case "python":
1472 subjectText = "Python";
1473 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/python-course";
1474 if (upshowcaselink.classList.contains("showcasebackend") == true) {
1475 upshowcase120.srcset = "/images/img_backend_120_python.png";
1476 upshowcase160.srcset = "/images/img_backend_160_python.png";
1477 upshowcase300.srcset = "/images/img_backend_300_python.png";
1478 upshowcase3001.srcset = "/images/img_backend_300_python.png";
1479 } else if (lowshowcaselink.classList.contains("showcasebackend") == true) {
1480 lowshowcase120.srcset = "/images/img_backend_120_python.png";
1481 lowshowcase160.srcset = "/images/img_backend_160_python.png";
1482 lowshowcase300.srcset = "/images/img_backend_300_python.png";
1483 lowshowcase3001.srcset = "/images/img_backend_300_python.png";
1484 }
1485 addTryitSpaces(subjectText);
1486 break;
1487 case "cs":
1488 subjectText = "C#";
1489 subjectLink = "https://shop.w3schools.com/collections/course-catalog/products/c-course";
1490 addTryitSpaces(subjectText);
1491 break;
1492 default:
1493 subjectText = "a";
1494 subjectLink = "https://shop.w3schools.com/collections/course-catalog";
1495 }
1496 if (typeof subjectText == 'undefined') {
1497 subjectText = "a";
1498 subjectLink = "https://shop.w3schools.com/collections/course-catalog";
1499 }
1500 if (subjectText != "a") {
1501 document.getElementById("courses_subject_text").innerHTML = "a " + subjectText + "<br>";
1502 document.getElementById("courses_subject_img_link").href = subjectLink;
1503 document.getElementById("courses_get_started_btn").href = subjectLink;
1504 }
1505 </script>
1506
1507
1508 <div id="stickypos" class="sidesection" style="text-align:center;position:sticky;top:50px;">
1509 <div id="stickyadcontainer">
1510 <div style="position:relative;margin:auto;">
1511
1512 <div id="adngin-sidebar_sticky-0"></div>
1513 <script>
1514 function secondSnigel() {
1515 if(window.adngin && window.adngin.adnginLoaderReady) {
1516 if (Number(w3_getStyleValue(document.getElementById("main"), "height").replace("px", "")) > 2200) {
1517 if (document.getElementById("adngin-mid_content-0")) {
1518 adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky", "mid_content" ]); });
1519 } else {
1520 adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky"]); });
1521 }
1522 } else {
1523 if (document.getElementById("adngin-mid_content-0")) {
1524 adngin.queue.push(function(){ adngin.cmd.startAuction(["mid_content"]); });
1525 }
1526 }
1527 } else {
1528 window.addEventListener('adnginLoaderReady', function() {
1529 if (Number(w3_getStyleValue(document.getElementById("main"), "height").replace("px", "")) > 2200) {
1530 if (document.getElementById("adngin-mid_content-0")) {
1531 adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky", "mid_content" ]); });
1532 } else {
1533 adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky"]); });
1534 }
1535 } else {
1536 if (document.getElementById("adngin-mid_content-0")) {
1537 adngin.queue.push(function(){ adngin.cmd.startAuction(["mid_content"]); });
1538 }
1539 }
1540 });
1541 }
1542 }
1543 </script>
1544
1545 </div>
1546 </div>
1547 </div>
1548
1549 <script>
1550 uic_r_c()
1551 </script>
1552
1553 </div>
1554 </div>
1555 <div id="footer" class="footer w3-container w3-white">
1556
1557 <hr>
1558
1559 <div style="overflow:auto">
1560 <div class="bottomad">
1561 <!-- BottomMediumRectangle -->
1562 <!--<pre>bottom_medium_rectangle, all: [970,250][300,250][336,280]</pre>-->
1563 <div id="adngin-bottom_left-0" style="padding:0 10px 10px 0;float:left;width:auto;"></div>
1564 <!-- adspace bmr -->
1565 <!-- RightBottomMediumRectangle -->
1566 <!--<pre>right_bottom_medium_rectangle, desktop: [300,250][336,280]</pre>-->
1567 <div id="adngin-bottom_right-0" style="padding:0 10px 10px 0;float:left;width:auto;"></div>
1568 </div>
1569 </div>
1570
1571 <hr>
1572 <div class="w3-row-padding w3-center w3-small" style="margin:auto">
1573 <div class="w3-col m12 w3-hide-medium w3-hide-small" style="width:20%">
1574 <a class="w3-btn ws-black w3-block w3-round" href="javascript:void(0);" onclick="displayError();return false" style="white-space:nowrap;text-decorati
1575 </div>
1576 <div class="w3-col m12 w3-hide-large">
1577 <a class="w3-btn ws-black w3-block w3-round" href="javascript:void(0);" onclick="displayError();return false" style="white-space:nowrap;text-decorati
1578 </div>
1579
1580
1581 <div class="w3-col m12 w3-hide-medium w3-hide-small" style="width:20%">
1582 <a class="w3-btn ws-black w3-block w3-round" href="/spaces/index.html" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:17px;fo
1583 </div>
1584 <div class="w3-col m12 w3-hide-large">
1585 <a class="w3-btn ws-black w3-block w3-round" href="/spaces/index.html" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:17px;fo
1586 </div>
1587
1588
1589 <div class="w3-col m12 w3-hide-medium w3-hide-small" style="width:20%">
1590 <a class="w3-btn ws-black w3-block w3-round" href="/pro/index.php" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:17px;font-f
1591 </div>
1592 <div class="w3-col m12 w3-hide-large">
1593 <a class="w3-btn ws-black w3-block w3-round" href="/pro/index.php" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:17px;font-f
1594 </div>
1595
1596 <div class="w3-col m12 w3-hide-medium w3-hide-small" style="width:20%">
1597 <a class="w3-btn ws-black w3-block w3-round" href="https://campus.w3schools.com/pages/newsletter" target="_blank" style="white-space:nowrap;text-deco
1598 </div>
1599 <div class="w3-col m12 w3-hide-large">
1600 <a class="w3-btn ws-black w3-block w3-round" href="https://campus.w3schools.com/pages/newsletter" target="_blank" style="white-space:nowrap;text-deco
1601 </div>
1602
1603
1604 <div class="w3-col m12 w3-hide-medium w3-hide-small" style="width:20%">
1605 <a class="w3-btn ws-black w3-block w3-round" href="https://shop.w3schools.com/collections/certifications" target="_blank" style="text-decoration:none
1606 </div>
1607
1608 <div class="w3-col m12 w3-hide-large">
1609 <a class="w3-btn ws-black w3-block w3-round" href="https://shop.w3schools.com/collections/certifications" target="_blank" style="text-decoration:none
1610 </div>
1611 </div>
1612
1613 <hr>
1614 <div class="ws-grey w3-padding w3-margin-bottom" id="err_form" style="display:none;position:relative">
1615 <span onclick="this.parentElement.style.display='none'" class="w3-button w3-display-topright w3-large">&times;</span>
1616
1617 <h2>Report Error</h2>
1618
1619 <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>
1620 <p>help@w3schools.com</p>
1621 <br>
1622
1623 <!--
1624 <h2>Your Suggestion:</h2>
1625 <form>
1626 <div class="w3-section">
1627 <label for="err_email">Your E-mail:</label>
1628 <input class="w3-input w3-border" type="text" style="margin-top:5px;width:100%" id="err_email" name="err_email">
1629 </div>
1630 <div class="w3-section">
1631 <label for="err_email">Page address:</label>
1632 <input class="w3-input w3-border" type="text" style="width:100%;margin-top:5px" id="err_url" name="err_url" disabled="disabled">
1633 </div>
1634 <div class="w3-section">
1635 <label for="err_email">Description:</label>
1636 <textarea rows="10" class="w3-input w3-border" id="err_desc" name="err_desc" style="width:100%;margin-top:5px;resize:vertical;"></textarea>
1637 </div>
1638 <div class="form-group">
1639 <button type="button" class="w3-button w3-dark-grey" onclick="sendErr()">Submit</button>
1640 </div>
1641 <br>
1642 </form>
1643 -->
1644
1645 </div>
1646 <div class="w3-container ws-grey w3-padding" id="err_sent" style="display:none;position:relative">
1647 <span onclick="this.parentElement.style.display='none'" class="w3-button w3-display-topright">&times;</span>
1648 <h2>Thank You For Helping Us!</h2>
1649 <p>Your message has been sent to W3Schools.</p>
1650 </div>
1651
1652 <div class="w3-row w3-center w3-small">
1653 <div class="w3-col l3 m6 s12">
1654 <div class="top10">
1655 <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top Tutorials</h5>
1656 <a href="/html/default.asp">HTML Tutorial</a><br>
1657 <a href="/css/default.asp">CSS Tutorial</a><br>
1658 <a href="/js/default.asp">JavaScript Tutorial</a><br>
1659 <a href="/howto/default.asp">How To Tutorial</a><br>
1660 <a href="/sql/default.asp">SQL Tutorial</a><br>
1661 <a href="/python/default.asp">Python Tutorial</a><br>
1662 <a href="/w3css/default.asp">W3.CSS Tutorial</a><br>
1663 <a href="/bootstrap/bootstrap_ver.asp">Bootstrap Tutorial</a><br>
1664 <a href="/php/default.asp">PHP Tutorial</a><br>
1665 <a href="/java/default.asp">Java Tutorial</a><br>
1666 <a href="/cpp/default.asp">C++ Tutorial</a><br>
1667 <a href="/jquery/default.asp">jQuery Tutorial</a><br>
1668 </div>
1669 </div>
1670 <div class="w3-col l3 m6 s12">
1671 <div class="top10">
1672 <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top References</h5>
1673 <a href="/tags/default.asp">HTML Reference</a><br>
1674 <a href="/cssref/index.php">CSS Reference</a><br>
1675 <a href="/jsref/default.asp">JavaScript Reference</a><br>
1676 <a href="/sql/sql_ref_keywords.asp">SQL Reference</a><br>
1677 <a href="/python/python_reference.asp">Python Reference</a><br>
1678 <a href="/w3css/w3css_references.asp">W3.CSS Reference</a><br>
1679 <a href="/bootstrap/bootstrap_ref_all_classes.asp">Bootstrap Reference</a><br>
1680 <a href="/php/php_ref_overview.asp">PHP Reference</a><br>
1681 <a href="/colors/colors_names.asp">HTML Colors</a><br>
1682 <a href="/java/java_ref_keywords.asp">Java Reference</a><br>
1683 <a href="/angular/angular_ref_directives.asp">Angular Reference</a><br>
1684 <a href="/jquery/jquery_ref_overview.asp">jQuery Reference</a><br>
1685 </div>
1686 </div>
1687 <div class="w3-col l3 m6 s12">
1688 <div class="top10">
1689 <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top Examples</h5>
1690 <a href="/html/html_examples.asp">HTML Examples</a><br>
1691 <a href="/css/css_examples.asp">CSS Examples</a><br>
1692 <a href="/js/js_examples.asp">JavaScript Examples</a><br>
1693 <a href="/howto/default.asp">How To Examples</a><br>
1694 <a href="/sql/sql_examples.asp">SQL Examples</a><br>
1695 <a href="/python/python_examples.asp">Python Examples</a><br>
1696 <a href="/w3css/w3css_examples.asp">W3.CSS Examples</a><br>
1697 <a href="/bootstrap/bootstrap_examples.asp">Bootstrap Examples</a><br>
1698 <a href="/php/php_examples.asp">PHP Examples</a><br>
1699 <a href="/java/java_examples.asp">Java Examples</a><br>
1700 <a href="/xml/xml_examples.asp">XML Examples</a><br>
1701 <a href="/jquery/jquery_examples.asp">jQuery Examples</a><br>
1702 </div>
1703 </div>
1704 <div class="w3-col l3 m6 s12">
1705 <div class="top10">
1706 <!--
1707 <h4>Web Certificates</h4>
1708 <a href="/cert/default.asp">HTML Certificate</a><br>
1709 <a href="/cert/default.asp">CSS Certificate</a><br>
1710 <a href="/cert/default.asp">JavaScript Certificate</a><br>
1711 <a href="/cert/default.asp">SQL Certificate</a><br>
1712 <a href="/cert/default.asp">Python Certificate</a><br>
1713 <a href="/cert/default.asp">PHP Certificate</a><br>
1714 <a href="/cert/default.asp">Bootstrap Certificate</a><br>
1715 <a href="/cert/default.asp">XML Certificate</a><br>
1716 <a href="/cert/default.asp">jQuery Certificate</a><br>
1717 <a href="//www.w3schools.com/cert/default.asp" class="w3-button w3-margin-top w3-dark-grey" style="text-decoration:none">
1718 Get Certified &raquo;</a>
1719 -->
1720
1721 <a href="https://shop.w3schools.com/collections/course-catalog" target="_blank"><h5 style="font-family: 'Source Sans Pro', sans-serif;">Get Certified</h5
1722 <a href="https://campus.w3schools.com/collections/certifications/products/html-certificate" target="_blank">HTML Certificate</a><br>
1723 <a href="https://campus.w3schools.com/collections/certifications/products/css-certificate" target="_blank">CSS Certificate</a><br>
1724 <a href="https://campus.w3schools.com/collections/certifications/products/javascript-certificate" target="_blank">JavaScript Certificate</a><br>
1725 <a href="https://campus.w3schools.com/collections/certifications/products/front-end-certificate" target="_blank">Front End Certificate</a><br>
1726 <a href="https://campus.w3schools.com/collections/certifications/products/sql-certificate" target="_blank">SQL Certificate</a><br>
1727 <a href="https://campus.w3schools.com/collections/certifications/products/python-certificate" target="_blank">Python Certificate</a><br>
1728 <a href="https://campus.w3schools.com/collections/certifications/products/php-certificate" target="_blank">PHP Certificate</a><br>
1729 <a href="https://campus.w3schools.com/collections/certifications/products/jquery-certificate" target="_blank">jQuery Certificate</a><br>
1730 <a href="https://campus.w3schools.com/collections/certifications/products/java-certificate" target="_blank">Java Certificate</a><br>
1731 <a href="https://campus.w3schools.com/collections/certifications/products/c-certificate" target="_blank">C++ Certificate</a><br>
1732 <a href="https://campus.w3schools.com/collections/certifications/products/c-certificate-1" target="_blank">C# Certificate</a><br>
1733 <a href="https://campus.w3schools.com/collections/certifications/products/xml-certificate" target="_blank">XML Certificate</a><br>
1734 <!--<a href="https://shop.w3schools.com/collections/course-catalog" target="_blank" class="w3-button w3-margin-top ws-black ws-hover-black w3-round" styl
1735 Get Certified &#10095;</a>-->
1736
1737 </div>
1738 </div>
1739 </div>
1740
1741 <hr>
1742 <div class="w3-opacity" style="font-size:12px;text-align:right;margin-bottom:16px;margin-right:8px;">
1743 <a href="/forum/default.asp" target="_blank" class="xw3-text-grey xw3-hover-text-black" style="text-decoration:none" title="Forum">FORUM</a> |
1744 <a href="/about/default.asp" target="_top" class="xw3-text-grey xw3-hover-text-black" style="text-decoration:none" title="About W3Schools">ABOUT</a>
1745 </div>
1746 <div class="w3-center w3-small w3-opacity">
1747 W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
1748 Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
1749 While using W3Schools, you agree to have read and accepted our <a href="/about/about_copyright.asp">terms of use</a>,
1750 <a href="/about/about_privacy.asp">cookie and privacy policy</a>.<br><br>
1751 <a href="/about/about_copyright.asp">Copyright 1999-2023</a> by Refsnes Data. All Rights Reserved.<br>
1752 <a href="//www.w3schools.com/w3css/default.asp">W3Schools is Powered by W3.CSS</a>.<br><br>
1753 </div>
1754 <div class="w3-center w3-small">
1755 <a href="//www.w3schools.com">
1756 <i class="fa fa-logo ws-text-green ws-hover-text-green" style="position:relative;font-size:42px!important;"></i>
1757 </div>
1758 <br><br>
1759 </div>
1760 </div>
1761 <script src="/lib/w3schools_footer.js?update=20220202"></script>
1762
1763 <script>
1764 MyLearning.loadUser('footer', function () {
1765 if (UserSession.loggedIn) {
1766 document.getElementById("signupbtn_topnav").style.display = "none";
1767 document.getElementById("spacesbtn_topnav").style.display = "block";
1768 } else {
1769 addMyLearnButt();
1770 }
1771 });
1772 function docReady(fn) {
1773 document.addEventListener("DOMContentLoaded", fn);
1774 if (document.readyState === "interactive" || document.readyState === "complete" ) {
1775 fn();
1776 }
1777 }
1778 uic_r_z();
1779 uic_r_d()
1780
1781 function addMyLearnButt() {
1782 let nav = document.getElementsByClassName("nextprev");
1783 if (document.body.contains(nav[1])) {
1784 if ((nav[1].firstElementChild.innerHTML.indexOf("Previous") || nav[1].firstElementChild.innerHTML.indexOf("Home") !== -1) && (nav[1].firstElementChil
1785 let myLearnButt = document.createElement("a");
1786 myLearnButt.innerHTML="Log in to track progress";
1787 myLearnButt.classList.add("w3-btn", "w3-hide-small", "myl-nav-butt");
1788 myLearnButt.href="https://www.w3schools.com/signup/?utm_source=classic&utm_medium=" + subjectFolder + "_tutorial&utm_campaign=button_lower_navigati
1789 myLearnButt.setAttribute("title", "Sign Up and improve Your Learning Experience");
1790 myLearnButt.setAttribute("target", "_blank");
1791 nav[1].classList.add("w3-center");
1792 nav[1].firstElementChild.insertAdjacentElement("afterend", myLearnButt);
1793 }
1794 }
1795 }
1796 </script>
1797
1798 <!--[if lt IE 9]>
1799 <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
1800 <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
1801 <![endif]-->
1802 </body>
1803 </html>
1804

You might also like