jQuery confirm() before click?

Hi,

Please look into the following code


<script language="javascript" type="text/javascript">

  $(document).ready(function(){
    
    $("#del").click(function () {
      $("#tmm1").hide("slow");
      
    });

  });

</script>

I want to put a confirm(), so before actually hiding the #tmm1 it should confirm it first with confirm(“Are you sure to hide”);

any ideas?


$(document).ready(function(){
    $("#del").click(function () {
        if (confirm('Are you sure to hide')) {
            $("#tmm1").hide("slow");
        }
    });
});

chairs pmw, that was fun :slight_smile:

  • Love jQuery