My First JavaScript

JavaScript makes HTML pages more dynamic and interactive.

Use JavaScript to Change Text

The HTML <script> tag is used to define a cilent-side script (JavaScript). The <script> element either contains script statements, or it points to an external script file through the <src> attribute.

This example writes "Hello JavaScript" into an HTML element with id="demo":

My First JavaScript

JavScript can change the content of an HTML element:

This is a demonstration.

JavaScript can change the style of an HTML element.

Here, a JavaScript changes the value of the src (source) attribute of an image.

The HTML <noscript> tag defines an alternate content to be displayed to users that have disabled scripts in their browser or have a browser that doesn't support script:

A browser without support for JavaScript will show the text written inside the noscript element.