Custom alert using Javascript

后端 未结 5 1803
长发绾君心
长发绾君心 2020-11-29 07:43

How can I create a custom alert function in Javascript?

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 08:06

    You can override the existing alert function, which exists on the window object:

    window.alert = function (message) {
      // Do something with message
    };
    

提交回复
热议问题