<html> <head> <title>Conditional Operator Demo</title> <script language="javascript" type="text/javascript"> <!-- confirmVal = confirm("click"); alertStr = confirmVal ? "You clicked OK": "You clicked Cancel"; alert(alertStr); //--> </script> </head> <body> <h1>JavaScript Test Page</h1> </body> </html>