Latest web development tutorials

VBScript GetRef function

VBScript Reference Complete VBScript Reference

GetRef VBScript subroutine function allows you to connect to a DHTML event on the page.

grammar

Set object.event=GetRef(procname)

参数 描述
object 必需。事件所关联的 HTML 对象的名称。
event 必需。要与函数绑定的事件的名称。
procname 必需。与 HTML 事件关联的 Sub 或 Function 过程的名称。

Examples

Examples

<button id="myBtn">Click me</button>

<script type="text/vbscript">

document.getElementById("myBtn").onclick=GetRef("mySub")

Sub mySub()
alert("Hello world")
End Sub

</script>

try it"

VBScript Reference Complete VBScript Reference