Professional Documents
Culture Documents
JavaScript Introduction
JavaScript Introduction
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP BOOTSTRAP HOW TO W3.CSS C C++ C# REACT R JQUERY DJANGO TYPESCRIPT NODEJS
Tutorials References Exercises Videos Upgrade Get Certified Free Website
JS Tutorial
JS HOME
JS Introduction
JavaScript Introduction
JS Where To
JS Output
JS Statements
JS Syntax ❮ Previous Next ❯
JS Comments
JS Variables
JS Let
JS Const This page contains some examples of what JavaScript can do.
JS Operators
JS Arithmetic
JS Assignment
JS Data Types
JS Functions JavaScript Can Change HTML Content
JS Objects
One of many JavaScript HTML methods is getElementById() . COLOR PICKER
JS Events
JS Strings The example below "finds" an HTML element (with id="demo"), and changes the element content (innerHTML) to "Hello JavaScript":
JS String Methods
JS String Search
JS String Templates Example
JS Numbers
JS BigInt document.getElementById("demo").innerHTML = "Hello JavaScript";
JS Number Methods
JS Number Properties Try it Yourself » Get certified
JS Arrays by completing
JS Array Methods
a JavaScript
JS Array Sort
course today!
JS Array Iteration
JavaScript accepts both double and single quotes:
JS Array Const
school
JS Dates w3 s
JS Date Formats
JS Date Get Methods
JS Date Set Methods
Example
2
CE
02
TI 2
R
FI .
ED
document.getElementById('demo').innerHTML = 'Hello JavaScript';
Try it Yourself »
Get started
Try it Yourself »
Example
document.getElementById("demo").style.fontSize = "35px";
Try it Yourself »
Example
document.getElementById("demo").style.display = "none";
Try it Yourself »
Example
document.getElementById("demo").style.display = "block";
Try it Yourself »
JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997.
ECMA-262 is the official name of the standard. ECMAScript is the official name of the language.
JavaScript Versions »
❮ Previous Next ❯
FORUM | ABOUT
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using
W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.