confirm

The 'confirm' function displays a given message in a popup window, and asks for user confirmation;
'confirm'函数使用弹窗提示用户确认相关操作。

  • Prototype: confirm(sMsg, sTitle);
  • Parameters:
    1. sMsg: specifies a message to display;
      需要显示的信息
    2. sTitle: specifies a title for the popup window;
      弹窗的标题
  • Return Value: true on pressing 'Yes', or false on 'No';
  • Example:
    var bYes=confirm('Are you sure you want to delete the file?');