代码示例:(标识:vbst_function)
<html>

<head>
<script type="text/vbscript">
function myFunction()
 myFunction = "蓝色"
end function
</script>
</head>

<body>
<script type="text/vbscript">
document.write("我喜欢的颜色是:" & myFunction())
</script>
<p>函数程序可返回结果。</p>
</body>

</html>
运行结果: