Current location - Quotes Website - Personality signature - How to display a dialog box in a web page
How to display a dialog box in a web page
You can use javascript scripting language, for example:

1. Open a text editor or notepad program and enter

& lthtml & gt

& lthead & gt& lt/head & gt;

& ltbody & gt& lt/body & gt;

& lt/html & gt;

In ...

& ltscript type = " text/JavaScript " & gt;

& lt/script & gt;

In ...

Function matching ()

{

Alert ("This window is a dialog box!" )

}

4. Then, define a function named queren () to pop up a confirmation box:

Function queren ()

{

Var se=confirm ("Please click a button!" );

if (se==true)

{

Alert ("You pressed OK");

}

other

{

Alert ("You pressed Cancel");

}

}

5. Continue to define another function tishi (), which is used to pop up a prompt box in the webpage.

Function tishi ()

{

Var t=prompt ("Please enter your name", "King Vision")

If (t! = null & amp& ampt! ="")

{

Document.write ("Wonderful MV is here," +t+ "! Your world ")

}

}

6, after the function definition, in

& lt input type = "button" onclick = "duihua ()" value = "Click to display the dialog box"/>

& lt input type = "button" onclick = "queren ()" value = "Click to display the confirmation box"/>

& lt input type = "button" onclick = "tishi ()" value = "Click to display the prompt box"/>

7. Save the file, open it with ie browser, click the corresponding button, and the corresponding dialog box will pop up.