Javascript tutorial - 26 - Dialogue Boxes , prompts, alerts, confirm
Dave Partner

Javascript tutorial - 26 - Dialogue Boxes , prompts, alerts, confirm

  • 0 Replies
  • 321 Views

0 Members and 1 Guest are viewing this topic.

*

Offline Dave Partner

  • Administrator
  • Full Member
  • *****
  • 116
    • View Profile

&index=25
<html>
   <head>
      <title></title>
   </head>
   <body>
      <script type="text/javascript" >
         /*
            DIALOGUE BOXES
            1. alert
            2. confirm
            3. prompt
            
         */
          /*
          function anythingRedirect(){
             var redirectValue = confirm("Are you really sure you want to redirect to DavePartner.com?"); //ok , cancel
             
             if(redirectValue == true){
                window.location = "http://davepartner.com";
             }else{
                alert("You selected cancel");
             }
             
          }
          */
         
         
          function anythingRedirect(){
             var redirectValue = prompt("Enter your email","Your email here" ); //ok , cancel
             
             document.write("The email you entered is :"+ redirectValue);
             
          }
      </script>
      
      
      <button onclick="anythingRedirect();"> Click here to visit DavePartner.com </button>
      
   </body>
</html>