Jquery Confirm Example - Jquery

How to get confirm alert in jquery?

Snippet Code

Rate this page :
  [ 0 votes]

Jquery confirm is an action used to confirm the users selection. Here the code creates a dialog box with a message to confirm users action. If ok is clicked then it confirms through another dialog box. The sample jquery confirm code is given below

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script> $(function() { $("#btn").click(function(){ if (!confirm("Do you want to delete")){ return false; } else { alert("You clicked ok..") } }); }); </script> <input type='button' value='Confirm' id='btn'>


Ask Questions

Ask Question