Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript GetRef function


May 13, 2021 VBScript


Table of contents


VBScript GetRef function

The VBScript GetRef function returns a reference to a procedure that can be bound to an event.


VBScript GetRef function Complete VBScript reference manual

The GetRef function allows you to connect a VBScript sub-program to a DHTML event on the page.

Grammar

Set object.event=GetRef(procname)

parameter describe
object Required.The name of the HTML object associated with the event.
event Required.The name of the event to be bound to the function.
procname Required.The name of the SUB or FUNCTION process associated with the HTML event.
<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 out . . .

VBScript GetRef function Complete VBScript reference manual