Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
JavaScript Tutorial Tutorials References Exercises Certificates Menu Search field × See More Sign In +1 Get Certified Upgrade Academy Spaces Practice Get Certified Upgrade Academy Spaces Practice My W3Schools Tutorials References Exercises Certificates Spaces Get Certified Plus Practice Academy All our Services Logout × × Tutorials Tutorials Learn web development, programming, data science, and more. W3SCHOOLS TUTORIALS: × ← All Topics × References W3SCHOOLS REFERENCES: × HTML Tag reference CSS Reference JavaScript Reference SQL Keyword reference Python Reference Java Reference C Reference C++ Reference Colors Color names PHP Reference HTML DOM Reference MySQL Reference W3.CSS Reference Bootstrap 3 Reference Bootstrap 4 Reference Node.js Reference Django Reference jQuery Reference Vue Attributes Angular Reference Sass Reference XML Reference JSON Reference ASP Reference Icons Reference SVG Reference Canvas Reference Charsets Reference Emojis Reference AppML Reference W3.JS Reference × Exercises Practice and test your skills with different exercises. Tip: Sign in to track your progress. Select another topic: × HTML Exercises CSS Exercises JavaScript Exercises SQL Exercises Python Exercises Java Exercises C Exercises C++ Exercises C# Exercises PHP Exercises React Exercises MySQL Exercises Excel Exercises DSA Exercises Bootstrap 3 Exercises Bootstrap 4 Exercises Bootstrap 5 Exercises Node.js Exercises TypeScript Exercises Django Exercises PostgreSQL Exercises jQuery Exercises NumPy Exercises Pandas Exercises Angular Exercises Git Exercises MongoDB Exercises R Exercises Go Exercises Kotlin Exercises Swift Exercises Vue Exercises SciPy Exercises Bash Exercises Choose an activity ← Back to topics Tip: Sign in to track your progress. × Get Certified W3SCHOOLS CERTIFICATES: × HTML CSS JavaScript SQL Python Java C C++ C# PHP React MySQL Excel DSA W3.CSS Bootstrap 3 Bootstrap 4 Bootstrap 5 Node.js TypeScript Django PostgreSQL jQuery Vue NumPy Pandas XML Cyber Security Accessibility AngularJS Git MongoDB R Go Kotlin SASS SciPy BASH Rust All Our Services Dark mode Services filter input × W3Schools offers a wide range of services and products for beginners and professionals, helping millions of people everyday to learn and master new skills. Free Tutorials Enjoy our free tutorials like millions of other internet users since 1999 References Explore our selection of references covering all popular coding languages Create a Website Create your own website with W3Schools Spaces - no setup required Exercises Test your skills with different exercises Quizzes Test yourself with multiple choice questions Code Challenges Test your skills with interactive code challenges Get Certified Document your knowledge Log in / Sign Up Create an account to track your progress League Earn XP and climb the ranks with different challenges Upgrade Become a PLUS user and unlock powerful features (ad-free, hosting, support,..) Where To Start Not sure where you want to start? Follow our guided path Code Editor (Try it) With our online code editor, you can edit code and view the result in your browser Bootcamps Learn from passionate instructors through live online sessions Templates We have created a bunch of responsive website templates you can use - for free! Web Hosting Host your own website, and share it to the world with W3Schools Spaces Create a Server Create your own server using Python, PHP, React.js, Node.js, Java, C#, etc. How To's Large collection of code snippets for HTML, CSS and JavaScript CSS Framework Build fast and responsive sites using our free W3.CSS framework Videos Learn the basics of HTML in a fun and engaging video tutorial Browser Statistics Read long term trends of browser usage Typing Speed Test your typing speed Color Picker Use our color picker to find different RGB, HEX and HSL colors. Newsletter Join our newsletter and get access to exclusive content every month Emojis Reference Check out our refererence page with all the emojis supported in HTML Code Game W3Schools Coding Game! Help the lynx collect pine cones UTF-8 Reference Check out our full UTF-8 Character reference Community Chat, Learn and Connect with Us on Discord Academy Contact us about W3Schools Academy for educational institutions For Businesses Contact us about W3Schools Academy for your organization Contact Us About sales: [email protected] About errors: [email protected] × HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP W3.CSS C C++ C# HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST TOOLS JS Tutorial JS Home JS Introduction JS Where To JS Output JS Syntax JS Syntax JS Statements JS Comments JS Variables JS Let JS Const JS Types JS Operators JS Operators JS Arithmetic JS Assignment JS Comparisons JS Conditional JS If Conditions JS If JS If Else JS Ternary JS Switch JS Booleans JS Logical JS Loops JS Loops JS Loop for JS Loop while JS Break JS Continue JS Control Flow JS Strings JS Strings JS String Templates JS String Methods JS String Search JS String Reference JS Numbers JS Numbers JS Number Methods JS Number Properties JS Number Reference JS Bitwise JS BigInt JS Functions Function Path Function Intro Function Invocation Function Parameters Function Returns Function Arguments Function Expressions Function Arrow Function Quiz JS Timers JS Objects Object Path Object Intro Object Properties Object Methods Object this Object Display Object Constructors JS Scope JS Scope JS Code Blocks JS Hoisting JS var/let/const JS Strict Mode JS Dates JS Dates JS Date Formats JS Date Get JS Date Set JS Date Methods JS Arrays JS Arrays JS Array Constructor JS Array Methods JS Array Search JS Array Sort JS Array Iterations JS Array Reference JS Array const JS Sets JS Sets JS Set Methods JS Set Logic JS Set WeakSet JS Set Reference JS Maps JS Maps JS Map Methods JS Map WeakMap JS Map Reference JS Iterations JS Loops JS Iterables JS Iterators JS Generators JS Math JS Math JS Math Reference JS Math Random JS RegExp JS RegExp JS RegExp Flags JS RegExp Classes JS RegExp Metachars JS RegExp Assertions JS RegExp Groups JS RegExp Quantifiers JS RegExp Patterns JS RegExp Objects JS RegExp Methods JS Data Types JS Data Types JS Primitive Data JS Object Types JS Symbols JS typeof JS undefined JS NaN JS toString() JS toLocaleString() JS Type Coercion JS Type Conversion JS Destructuring JS Errors JS Errors Intro JS Errors Silent JS Error Statements JS Error Object JS Debugging Debug Intro Debug Console Debug Breakpoints Debug Errors Debug Async Debug Reference JS Style Guide JS Style Guide JS Best Practices JS Mistakes JS Performance JS Reference JS Alphabetic JS Statements JS Keywords JS Operators JS Precedence JS Projects New JS Counter JS Event Listener JS To-Do List JS Modal Popup JS Form Validation JS Versions JS 2027 JS 2026 JS 2025 JS 2024 JS 2023 JS 2022 JS 2021 JS 2020 JS 2019 JS 2018 JS 2017 JS 2016 JS 2015 (ES6) JS 2009 (ES5) JS 1999 (ES3) JS Versions JS History JS HTML DOM HTML DOM HTML DOM API Selecting Elements Changing HTML Changing CSS Form Validation DOM Animations Document Reference Element Reference JS HTML Events Intro to Events Mouse Events Keyboard Events Load Events Manage Events Event Examples Event Listener JS HTML First HTML First HTML Progressive HTML First Features HTML First CSS JS Web API JS Window API JS Window JS Screen JS Location JS History JS Navigator JS Popup Alert JS Cookies JS Fetch API JS JSON JSON Intro JSON Syntax JSON Values JSON Parse JSON Stringify JSON Fetch JSON HTML JSON vs XML JS Web API APIs Intro API Geolocation API Web Pointer API Web Storage API Validation API Web Worker JS Advanced JS Temporal New Temporal Intro Temporal Why Temporal vs Date Temporal Duration Temporal Instant Temporal PlainDateTime Temporal PlainDate Temporal PlainYearM Temporal PlainMonthD Temporal PlainTime Temporal ZonedDate Temporal Now Temporal Arithmetic Temporal Since/Until Temporal Compare Temporal Conversion Temporal Formats Temporal Mistakes Temporal Migrate Temporal Standards Temporal Reference JS Functions Functions Advanced Function Definitions Function Callbacks Function this Function Call Function Apply Function Bind Function IIFE Function Closures Function Reference Function Quiz JS Objects Object Study Path Object Definitions Object this Object Iterations Object Get / Set Object Management Object Protection Object Prototypes Object Reference JS Classes JS Classes JS Class Inheritance JS Class Static JS Asynchronous Async Study Path Async Programming Async Callbacks Async Promises Async Await Async Parallel Async Event Loop Async Fetch API Async Mistakes Async Debugging Async AbortControl Async Web Workers Async Reference JS Modules Modules Intro Modules Export Modules Import Modules Namespace Modules Dynamic JS Meta & Proxy Meta Programming Meta Reflect Meta Proxy Meta Reference JS Typed Arrays Typed Arrays Typed Methods Typed Reference Array Buffers DataViews JS Atomics JS DOM Navigation DOM Navigation DOM Nodes DOM Collections DOM Node Lists JS Graphics JS Graphics JS Canvas JS Plotly JS Chart.js JS Google Chart JS D3.js Old Technologies JS AJAX AJAX Intro AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples JS jQuery jQuery Selectors jQuery HTML jQuery CSS jQuery DOM JS JSONP JS Examples JS Examples JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JavaScript Tutorial Home Next Learn JavaScript The Programming Language of the Web JavaScript is easy to learn. This tutorial covers everything from basic JavaScript up to the latest 2026 version. Start learning JavaScript now » Examples in Each Chapter With our Try it Yourself editor, you can edit the source code and view the result. Example My First JavaScript Click me to display Date and Time Try it Yourself » Use the Menu We recommend reading this tutorial, in the sequence listed in the menu. If you have a large screen, the menu will always be present on the left. If you have a small screen, open the menu by clicking the top menu sign . Learn by Examples Examples are better than 1000 words. Examples are often easier to understand than text explanations. This tutorial supplements all explanations with clarifying Try it Yourself examples. If you try all the examples, you will learn a lot about JavaScript, in a very short time! JavaScript Examples » Why Study JavaScript? JavaScript is one of the 3 languages all web developers must learn: HTML to define the content of web pages CSS to specify the layout of web pages JavaScript to program the behavior of web pages Learning Speed In this tutorial, the learning speed is your choice. Everything is up to you. If you are struggling, take a break, or re-read the material. Always make sure you understand all the "Try-it-Yourself" examples. The only way to become a clever programmer is to: Practice coding! Practice coding! Practice coding! Commonly Asked Questions How do I get JavaScript? Where can I download JavaScript? Is JavaScript Free? You don't have to get or download JavaScript. JavaScript is already running in your browser on your computer, on your tablet, and on your smart-phone. JavaScript is free to use for everyone. JavaScript Exercises Many chapters in this tutorial end with an exercise where you can check your level of knowledge. See all JavaScript Exercises JavaScript Quiz Test Test your JavaScript skills at W3Schools! Start JavaScript Quiz! Track Your Progress Create a W3Schools account and get access to more features and learning materials: View your completed tutorials, exercises, and quizzes Keep an e…