当前位置:编程学习 > JS >>

jquery 确认提示框代码

<!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.zzzyk.com/1999/xhtml">
<head>
<title>jquery.confirmer.js</title>
  <meta http-equiv="Content-Type" content="text/html; char set=utf-8" />
<script type="text/javascript教程" language="javascript" src="js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.confirmer.js"></script>
<script type="text/javascript">
$().ready(function(){
$(".delete").confirmer();
//$(".delete").confirmer({msg:'确认删除吗?'});
})
</script>
</head>
<body>
<button id="btnDelete" class="delete">删除</button>
<a id="lnkDelete" class="delete" href=http://www.zzzyk.com>删除</a>
</body>
</html>


(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);

补充:网页制作,jquery
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,