Html Javascript Confirm Box Dialog Yes No OK Cancel

HTML
Copy to clipboard
fablecode
  1. <!-- Source: http://www.worldofwebcraft.com/blog.php?id=1 -->
  2.  
  3. <script type="text/javascript">
  4.  
  5. function deleteImage(x){
  6.  
  7.     var conf = confirm("Are you sure you want to delete this image?");
  8.  
  9.     if(conf == true){
  10.  
  11.          alert("OK... you chose to proceed with deletion of "+x);
  12.  
  13.     }
  14.  
  15. }
  16.  
  17.  
  18. <input name="myBtn" type="button" onClick="deleteImage('images/pic.jpg')" value="Delete Image">

    Leave a comment

     
    Visual verification
     

    Related books

    More InfoHTML & CSS For Beginners: Your Step by Step Guide to Easily HtmL & Css Programming  in 7 Days
    HTML & CSS For Beginners: Your Step by Step Guide to Easily HtmL & Css Programming in 7 Days
    More InfoProgramming: Computer Programming For Beginners: Learn The Basics Of HTML5, JavaScript & CSS (Coding, C Programming, Java Programming, Web Design, JavaScript, Python, HTML and CSS)
    Programming: Computer Programming For Beginners: Learn The Basics Of HTML5, JavaScript & CSS (Coding, C Programming, Java Programming, Web Design, JavaScript, Python, HTML and CSS)
    More InfoHTML and CSS: Design and Build Websites
    HTML and CSS: Design and Build Websites
    More InfojQuery For Beginners: Your Guide To Easily Learn jQuery Programming in 7 days
    jQuery For Beginners: Your Guide To Easily Learn jQuery Programming in 7 days
    More InfoHTML & CSS In A Week ...Or Less
    HTML & CSS In A Week ...Or Less
    More InfoPROGRAMMING For BEGINNERS
    PROGRAMMING For BEGINNERS
    More InfoProgramming: Computer Programming for Beginners - Learn the Basics of Java, SQL & C++
    Programming: Computer Programming for Beginners - Learn the Basics of Java, SQL & C++
    More InfoHTML Programming Professional Made Easy: Expert HTML Programming Language Success in a Day for any Computer Users
    HTML Programming Professional Made Easy: Expert HTML Programming Language Success in a Day for any Computer Users