HTML Script

JavaScript makes HTML pages more dynamic and interactive.

Online examples

Insert a script
How to insert a script into an HTML document.

Use <noscript> tag
How to deal with does not support scripting or disable the browser script.

HTML <script> Tag

The <script> tag is used to define client-side script, such as JavaScript.

The <script> element can contain script statements, or point to an external script file through the src attribute.

JavaScript is most commonly used for image manipulation, form validation, and dynamic content updates.

The following script will output “Hello World!” to the browser:


  document.write("Hello World!");
Tip: To learn more about Javascript tutorial, please check JavaScript tutorial !

HTML<noscript> Tag

The <noscript> tag provides alternative content when scripts cannot be used, such as when scripts are disabled in the browser, or when the browser does not support client-side scripting.

The <noscript> element can contain all the elements that can be found in the body element of a normal HTML page.

The content in the <noscript> element will only be displayed when the browser does not support scripting or scripting is disabled:


 document . write (" Hello World! ") 
  Sorry, your browser does not support JavaScript !

JavaScript experience (from this site javascript tutorial)

JavaScript example code:

JavaScript can be output directly in HTML:
document.write (" <p>This is a paragraph.</p> ");
JavaScript event response:
<button type="button" onclick="myFunction()">
  Click Me
JavaScript handles HTML style:

HTML script tag

label description
<script> Client script defined
<noscript> Defines text that does not support script browser output