On click Redirect to a new link in JQuery

#On click Redirect to a new link in JQuery:

HTML:
<a id="delete-button">Delete</a>

JQuery:

<script>
$("#delete-button").click(function(){
    if(confirm("Are you sure you want to delete this?")){
        $("#delete-button").attr("href", "query.php?ACTION=delete&ID='1'");

    }
    else{
        return false;
    }
});
</script>
Please follow and like us:
0

Leave a Reply

Your email address will not be published. Required fields are marked *