Search w3schools.com:

SHARE THIS PAGE

VBScript How To


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. 

lamp 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.




Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]