Top Questions

  • 2.9 Years

    • Category : Jquery
    • Location : Chandigarh
    • Posted On : Jan 22, 2016

    add confirmation alert before your link active

    function confirmDelete(delUrl) {
      if (confirm("Are you sure you want to delete")) {
        document.location = delUrl;
    <a href="javascript:confirmDelete('')">Delete</a>
    <a href="" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
    use this cdn's in your header
    <a href="" class="confirmation">Delete</a>
    jQuery('.confirmation').click(function (e) {
        var href = jQuery(this).attr('href');
            title: "Are you sure?",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes",
            cancelButtonText: "No",
            closeOnConfirm: true,
            closeOnCancel: true
                function (isConfirm) {
                    if (isConfirm) {
                        window.location.href = href;
        return false;

Add Your Answer

When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.