The following example will display an OK/Cancel message:
<html> <head> <script language="JavaScript"> function displayOkCancel() { if (confirm('Are you sure?')) { alert('User pressed ok.'); } else { alert('User pressed cancel.'); } } </script> </head> <body> <input type="button" onclick="displayOkCancel();" value="Click Me!"/> </body> </html>
|