HTML Tutorial
HTML - Introduction HTML - Basic HTML - Structure HTML - Element HTML - Attributes HTML - Headings HTML - Paragraphs HTML - Styles HTML - Formatting HTML - Phrase Tags HTML - Quotations HTML - Comments HTML - Colors HTML - CSS HTML - Links HTML - Images HTML - Tables HTML - List HTML - Inline elements HTML - Block elements HTML - Classes HTML - Id HTML - Javascript HTML - File Path HTML - Iframe HTML - Responsive HTML - Computer Code HTML - Head tag HTML - Events HTML - Url Encoding HTML - Entities HTML - Validation
HTML Forms
HTML - Forms HTML - Form Elements HTML - Input types HTML - Input Attributes
HTML5 - Introduction HTML5 - New Elements HTML5 - Semantics HTML5 - Style Guide
HTML Media
HTML - Video HTML - Audio HTML - Embed Multimedia
HTML Graphics
HTML - Canvas HTML - SVG
HTML - Geolocation HTML - Drag & drop HTML - Web Storage HTML - Web Workers
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types

HTML JavaScript

JavaScript is a scripting language that is run by most modern browsers. It makes HTML pages more dynamic and interactive.

JavaScript can be used to control web pages on the client side of the browser.

Click on the buttons below to see how JavaScript works:

HTML <script> Tag

The <script> element is used to define a client-side script (JavaScript).

Run code

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.

Common uses for JavaScript are event capturing, form validation, and dynamic changes of content.

External JavaScript

You can place your scripts into a separate file, and then call that file through the src attribute in your HTML document.

A JavaScript file will have extension as .js and it will be included in HTML files using <script> tag.

The following example point to an external JavaScript file:

Run code

This is useful if you want the same scripts available to multiple documents.

JavaScript Examples

Below are some examples of what JavaScript can do:

JavaScript can change HTML text:

Run code

JavaScript can change HTML styles:

Run code

JavaScript can change HTML attributes:

Run code

JavaScript can hide and show HTML elements:

Run code

To learn more about JavaScript, visit: Javascript Tutorial.

HTML <noscript> Tag

You can also provide alternative info to the users whose browsers don't support javascript and for those users who have disabled javascript on their browsers. You can do this using the <noscript> tag.

Run code

The <noscript> element can be used in both <head> and <body>.

HTML Script Tags

Tag Description
<script> Specifies a client-side script
<noscript> Specifies an alternate content for users that do not support client-side scripts