VBScript How To

## VBScript Tutorial

VB HOME VB How to VB Variables VB Procedures VB Conditional VB Looping VB Summary

## VB Examples

VB Examples

## VB References

VB Functions VB Keywords

# VBScript How To

« Previous
Next Chapter »

The HTML <script> tag is used to insert VBScript in HTML.

## VBScript in HTML

VBScript is inserted into HTML, between standard <script> and </script> tags.

Use the type attribute in the <script> tag to define the scripting language "text/vbscript":

<html>
<body>
<script type="text/vbscript">
...
</script>
</body>
</html>

IE will interpret and execute the VBScript code between the <script> and </script> tags.

| VBScript should not be used as a client-side scripting language! Here, we use VBScript in IE only for learning.

## VBScript Output

When VBScript is used on a web server in an ASP page, the statement response.write() produces output.

When we use Internet Explorer for testing VBScript, we use document.write() to produce output:

## Example (Internet Explorer Only)

<html>
<body>
<script type="text/vbscript">
document.write("Hello World!")
</script>
</body>
</html>
Try it yourself »

In the example above, the browser will write "Hello World!" to the HTML page.

« Previous
Next Chapter »

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE