May 28, 2023 < Last UPdate

 So - before JavaScript will make any sense to you - YOU must learn abot the InterNet, the "browser", "HTML", "tags" - AND the <!-- Google Tag Manager -->

The InterNet ( as a node-to-node technology ) was invented by the US Military ( ) ... The "online world" then took on a more recognizable form [from the year 2023 perspective] in 1990, when computer scientist Tim Berners-Lee invented the World Wide Web. While it’s often confused with the internet itself, the "web" is actually just the most common means of accessing data "online" in the form of websites and hyperlinks.  ... ( )

"browser"  ( )  "... Early web users were free to choose among the handful of web browsers available, just as they would choose any other application—web standards would ensure their experience remained largely the same. The "browser wars" [ Late 1990s: Microsoft vs Netscape ] put the Web in the hands of millions of ordinary PC users, but showed how commercialization of the Web could stymie standards efforts. Both Microsoft and Netscape liberally incorporated proprietary extensions to HTML in their products, and tried to gain an edge by product differentiation, leading to a web - by the late 1990s - where only Microsoft or Netscape browsers were viable contenders. In a victory for a standardized web, Cascading Style Sheets, proposed by Håkon Wium Lie, were accepted over Netscape's JavaScript Style Sheets (JSSS) by W3C
 (  ) ..."

 HTML ( ) ( ) "... The HyperText Markup Language [HTML]  is the standard markup language for documents [pages] designed to be displayed in a web browser. It is often assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.

Web browsers (above) receive HTML documents ( name.html ) from a web server or from local storage and render the documents into multimedia web pages. HTML describes the structure of a web page semantically and originally included cues for its appearance. (  ) 

HTML elements are the building blocks of HTML pages ( name.html ). With HTML constructs, images and other "objects" such as interactive forms may be embedded into the rendered page. Which, "Users" interact with - via links, etc. - most often simultaneous with viewing the "page" - on a computer monitor. ... HTML provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes, and other items. HTML elements are delineated by tags, written using angle brackets. Tags such as <img /> and <input /> directly introduce content into the page. Other tags such as <p> and </p> surround and provide information about document text and may include sub-element tags. Browsers do not display the HTML tags but use them to interpret the content of the page. ...HTML can embed (contain)  programs written in a scripting language such as JavaScript, which affects the behavior and content of displayed web pages. The inclusion of CSS [also] defines the look and layout of displayed page content. The World Wide Web Consortium (W3C), former maintainer of the HTML and current maintainer of the CSS standards, has encouraged the use of CSS over explicit presentational HTML since 1997.[2] A form of HTML, known as HTML5, is used to display video and audio, primarily using the <canvas> element, together with JavaScript. ..." (  )

 (  ) ( ) 

"tags"  HTML Tags Ordered Alphabetically >  ( )

"Google Tag Manager" (  )   < BEGIN JavaScript Tutorial  - This tutorial will teach you JavaScript  from basic to advanced. 

JS Introduction > 

"...  JavaScript Introduction ...some examples of what JavaScript can do.

JavaScript Can Change HTML Content
One of many JavaScript HTML methods is getElementById().

The example below "finds" an HTML element (with id="demo"), and changes the element content (innerHTML) to "Hello JavaScript":

document.getElementById("demo").innerHTML = "Hello JavaScript";

NOTE: JavaScript accepts both double and single quotes:

document.getElementById('demo').innerHTML = 'Hello JavaScript';

JavaScript Can Change HTML Attribute Values
  In this example, JavaScript changes the value of the src (source) attribute of an <img> tag:

The Light Bulb
Turn on the light  Turn off the light

JavaScript Can Change HTML Styles (CSS)
 Changing the style of an HTML element, is a variant of changing an HTML attribute:

document.getElementById("demo").style.fontSize = "35px";

JavaScript Can Hide HTML Elements
  Hiding HTML elements can be done by changing the display style:

document.getElementById("demo").style.display = "none";

JavaScript Can Show HTML Elements
Showing hidden HTML elements can also be done by changing the display style:

document.getElementById("demo").style.display = "block";

NOTE! JavaScript and Java are completely different languages, both in concept and design. "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. ..."


  In AN HTML file ( name.html ), JavaScript code is inserted between <script> and </script> tags.

document.getElementById("demo").innerHTML = "My First JavaScript";

NOTE: Old JavaScript examples may use a type attribute: <script type="text/javascript">.
Today ( 2023 ) The type attribute is not required. JavaScript is the default scripting language in HTML.

****** JavaScript Functions and Events
A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
For example, a function can be called when an event occurs, like when the user clicks a button.

Example: JavaScript in <head> or <body>
You can place any number of scripts in an HTML document.

Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.

Example: JavaScript in <head>
In this example, a JavaScript function is placed in the <head> section of an HTML page.

The function is invoked (called) when a button is clicked:

<!DOCTYPE html>
function myFunction() {
  document.getElementById("demo").innerHTML = "Paragraph changed.";

<h2>Demo JavaScript in Head</h2>

<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>


JS Output >
JS Statements
JS Syntax
JS Comments
JS Variables
JS Let
JS Const
JS Operators
JS Arithmetic
JS Assignment
JS Data Types
JS Functions
JS Objects
JS Events
JS Strings
JS String Methods
JS String Search
JS String Templates
JS Numbers
JS BigInt
JS Number Methods
JS Number Properties
JS Arrays
JS Array Methods
JS Array Sort
JS Array Iteration
JS Array Const
JS Dates
JS Date Formats
JS Date Get Methods
JS Date Set Methods
JS Math
JS Random
JS Booleans
JS Comparisons
JS If Else
JS Switch
JS Loop For
JS Loop For In
JS Loop For Of
JS Loop While
JS Break
JS Iterables
JS Sets
JS Maps
JS Typeof
JS Type Conversion
JS Bitwise
JS RegExp
JS Precedence
JS Errors
JS Scope
JS Hoisting
JS Strict Mode
JS this Keyword
JS Arrow Function
JS Classes
JS Modules
JS Debugging
JS Style Guide
JS Best Practices
JS Mistakes
JS Performance
JS Reserved Words

JS Versions
JS Versions
JS 2009 (ES5)
JS 2015 (ES6)
JS 2016
JS 2017
JS 2018
JS 2019
JS 2020
JS 2021/2022
JS IE / Edge
JS History

JS Objects
Object Definitions
Object Properties
Object Methods
Object Display
Object Accessors
Object Constructors
Object Prototypes
Object Iterables
Object Sets
Object Maps
Object Reference

JS Functions
Function Definitions
Function Parameters
Function Invocation
Function Call
Function Apply
Function Bind
Function Closures

JS Classes
Class Intro
Class Inheritance
Class Static

JS Async
JS Callbacks
JS Asynchronous
JS Promises
JS Async/Await

DOM Intro
DOM Methods
DOM Document
DOM Elements
DOM Forms
DOM Animations
DOM Events
DOM Event Listener
DOM Navigation
DOM Nodes
DOM Collections
DOM Node Lists

JS Browser BOM
JS Window
JS Screen
JS Location
JS History
JS Navigator
JS Popup Alert
JS Timing
JS Cookies

Web API Intro
Web Forms API
Web History API
Web Storage API
Web Worker API
Web Fetch API
Web Geolocation API

AJAX Intro
AJAX Request
AJAX Response
AJAX Database
AJAX Applications
AJAX Examples

JSON Intro
JSON Syntax
JSON Data Types
JSON Parse
JSON Stringify
JSON Objects
JSON Arrays
JSON Server

JS vs jQuery
jQuery Selectors
jQuery HTML
jQuery CSS
jQuery DOM

JS Graphics
JS Graphics
JS Canvas
JS Plotly
JS Chart.js
JS Google Chart
JS D3.js

JS Examples
JS Examples
JS HTML Objects
JS HTML Events
JS Browser
JS Editor
JS Exercises
JS Quiz
JS Bootcamp
JS Certificate

JS References
JavaScript Objects
HTML DOM Objects