VBScript Usage

Example

Use VBScript to write text
How to write text on the page.
Use HTML tags to format text
How to collaborate with HTML tags and VBScript.

How to place VBScript in an HTML document

<html>
<head>
</head>
<body>
<script type="text/vbscript">
document.write("Hello from VBScript!")
</script>
</body>
</html>

The above code will generate the following output:

Hello from VBScript!

To insert a script into an HTML document, please use the <script> tag. Use the type attribute to define the script language.

<script type="text/vbscript">

Then enter VBScript: The command to write text on the page is document.write:

document.write("Hello from VBScript!")

The script ends here:

</script>

How to deal with old browsers

Old browsers that do not support scripts will display the script as part of the web page content. To avoid this, we can use HTML comment tags:

<script type="text/vbscript">
<!--
  Enter the statement here
-->
</script>