DHTML Methods
Displays a Confirm dialog box that contains the specified sMessage as well as OK and Cancel buttons.
bChoice = window.confirm ( [ sMessage ] )
sMessage |
Optional. String to display in the Confirm dialog box. If no value is provided, the dialog box will have no message. |
Boolean. Returns true
if the user chooses OK, or false
if the user chooses Cancel.
The title bar of the Confirm dialog box cannot be changed.
The following script will display a simple Confirm dialog box and store the user's choice to a variable named sure, which can then be used to trigger another function.
<script language="JavaScript">
function makeSureFirst ( ) {
sure = confirm ( "Are you sure?" );
if ( sure ) deleteMyWebSite ( );
}
</script>
Show me
window
alert, prompt