JavaScript Confirm Box Example

A confirm box is often use to verify or accept some confirm message and display on browser. When a confirm box display on browser, the user allow to click either "OK" or "Cancel" to proceed.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>JavaScript Confirm Box</title>
</head>
<body>

  <input type="button" onclick="confirm('Are you sure you want to learn next chapter?')" value="Open Confirm Box" />

</body>
</html>

Run it...   »

Example Result