Home > Web Front-end > JS Tutorial > Confirmer JQuery confirmation dialog component_jquery

Confirmer JQuery confirmation dialog component_jquery

WBOY
Release: 2016-05-16 18:25:31
Original
1388 people have browsed it

Plug-in screenshot:

Confirmer JQuery confirmation dialog component_jquery

Purpose: To confirm whether to continue the current operation when clicking a link or button.

Plug-in code:

Copy code The code is as follows:

(function($){
$.fn.confirmer = function(options){
var defaults = {
msg:"Are you sure to delete it?"
}
var options = $.extend(defaults , options);
var control=$(this);
$(control).click(function(){return confirm(options.msg);});
};
}) (jQuery);

Usage:
1.$(".delete").confirmer();
2.$(".delete").confirmer({msg: 'Confirm deletion? '});
Example:
Copy code The code is as follows:




jquery.confirmer.js
< ;meta http-equiv="Content-Type" content="text/html; char set=utf-8" />





< ;button id="btnDelete" class="delete">Delete



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template