Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <link href="http://tristanedwards.me/u/SweetAlert/lib/sweet-alert.css" rel="stylesheet" type="text/css" />
    <meta charset="utf-8">
    <title>JS Bin</title>
  </head>
  <body>
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script src="http://tristanedwards.me/u/SweetAlert/lib/sweet-alert.js"></script>
    <a href="http://jquery.com" class="delete" >Alert !!</a>
  </body>
</html>
 
$(document).ready(function () {
  $('.delete').on('click',function(e, data){
    if(!data){
      handleDelete(e, 1);
    }else{
      window.location = $(this).attr('href');
    }
  });
});
function handleDelete(e, stop){
  if(stop){
    e.preventDefault();
    swal({
      title: "Are you sure?",
      text: "You will not be able to recover the delaer again!",
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "Yes, delete!",
      closeOnConfirm: false
    },
    function (isConfirm) {
      if (isConfirm) {
        $('.delete').trigger('click', {});
      }
    });
  }
};
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
dhirajbodicherlapro
0viewers