The HTML tag is used to insert a VBscript into an HTML page.
Put a VBscript into an HTML Page
The example below shows how to use VBSript to write text on a web page:
Example (IE Only)
document.write("Hello World!")
Try it yourself »
The example below shows how to add HTML tags to the VBscript:
Example (IE Only)
document.write("
Try it yourself »
Example Explained
To insert a VBscript into an HTML page, we use the tag. Inside the tag we use the type attribute to define the scripting language.
So, the and tells where the VBscript starts and ends:
...
The document.write command is a standard VBscript command for writing output to a page.
By entering the document.write command between the and tags, the browser will recognize it as a VBscript command and execute the code line. In this case the browser will write Hello World! to the page:
document.write("Hello World!")
How to Handle Simple Browsers
Browsers that do not support scripting, will display VBscript as page content.
To prevent them from doing this, the HTML comment tag should be used to "hide" the VBscript.
Just add an HTML comment tag (end of comment) after the last VBscript statement, like this:
Put a VBscript into an HTML Page
The example below shows how to use VBSript to write text on a web page:
Example (IE Only)
document.write("Hello World!")
Try it yourself »
The example below shows how to add HTML tags to the VBscript:
Example (IE Only)
document.write("
Hello World!
")Try it yourself »
Example Explained
To insert a VBscript into an HTML page, we use the
So, the
...
The document.write command is a standard VBscript command for writing output to a page.
By entering the document.write command between the
document.write("Hello World!")
How to Handle Simple Browsers
Browsers that do not support scripting, will display VBscript as page content.
To prevent them from doing this, the HTML comment tag should be used to "hide" the VBscript.
Just add an HTML comment tag (end of comment) after the last VBscript statement, like this: