The MsgBox function displays a message in a dialog box, waits for the user to click the button, and returns a value that instructs the user to click the button in the following syntax format:
MsgBox (Prompt[,buttons][,title][,helpfile,context])
Prompt: Specifies the string to display in the dialog box
Buttons: Specifies the number and type of display buttons, the icon style used, and the default value is 0 (parameters are shown in the table below)
Title: String displayed in the title bar of the dialog box
HelpFile: is a string that identifies the help file that provides context-sensitive Help for a dialog box
Context: is a numeric value that identifies the contextual number assigned to a Help topic by the author of the Help file
Example:
==================================================
<script language= "VBScript" >
Dim ans
Ans=msgbox ("Do you want to visit the small Lotus pond?", vbyesno+vbquestion, "hint info")
If Ans=vbyes Then
Window.navigate "Http://www.xxxx.net"
Else
document.write "Welcome to our site!" ”
End If
</script>
==================================================
The display effect is as follows:
The InputBox function displays a prompt in the dialog box, and so on, the user enters text or clicks the button and returns the contents of the text box.
InputBox (Prompt[,title][,default][,xpos][,ypos][,helpfile,context])
Prompt: Specifies the string to display in the dialog box
Title: String displayed in the title bar of the dialog box
Defaults: Default string displayed in a text box
Xpos: is a numeric value that specifies the distance between the left edge of the dialog box and the left edge of the screen, and if omitted, the dialog box is centered horizontally
Ypos: is a numeric value that specifies the distance between the top edge of the dialog box and the top edge of the screen, and if omitted, the dialog box appears in the vertical direction of the screen about 1/3 places below the edge
HelpFile: is a string that identifies the help file that provides context-sensitive Help for a dialog box
Context: is a numeric value that identifies the contextual number assigned to a Help topic by the author of the Help file
Example:
=================================================
<script language= "VBScript" >
Dim UserName
Username=inputbox ("Please enter your name:", "Enter the name", "Zhang Mowgli")
If username= "" Then
Document.Write "You did not enter a name. ”
Else
document.write "Welcome," & UserName & "Friends. ”
End If
</script>
=================================================
Results see the following figure: