Any JQuery alert() replacement for JavaScript's native one?

前端 未结 9 856
心在旅途
心在旅途 2021-02-06 16:32

I would like to replace the native javascript alert() with my own, so that I would be able to control the theme and have it more JQueryUI look and feel. I\'ve tried numerous alt

9条回答
  •  北海茫月
    2021-02-06 16:56

    a jquery alert:

      JQuery.fn.alert = function(message) {
         alert(message);
      };
    

    example of using:

     $("#item1").alert("hello");
    

    oh my god :D

    the jquery is only a DOM framework. this not an other javascript! jquery is only some javascript lines. and not replacing javascript.

    if you want to create a dialog box then i can suggest you to search for jquery plugin.

    http://choosedaily.com/1178/15-jquery-popup-modal-dialog-plugins-tutorials/

提交回复
热议问题