📜  js 确认 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:25.445000             🧑  作者: Mango

代码示例6
// The confirm function is used to display a dialog with ok and cancel. Usage:

var content = confirm("Hello"); // The "hello" means to show the following text
if (content === true) {
  // Do whatever if the user clicked ok.
} else {
  // Do whatever if the user clicks cancel.
}

// You can also use window.confirm()