Prompt Dialog Box in JavaScript || JavaScript Dialog Box

In this video,I explained the Prompt Dialog Box in JavaScript. Feel free to comment. For more, please subscribe and press the BELL icon. Please visit my JavaScript Playlist. The code is as follows -

HTML Code - 
<html>
  <head>
     <title> Prompt Dialog Box </title>
  </head>
 
  <body>
    <p> Press this BUTTON </p>
<button onclick="myprompt()"> Prompt Concept </button>
<p id="prompt"> </p>

<script>
  function myprompt() {
   var x = prompt("Please enter your name");
   if (x != null) {
     document.getElementById("prompt").innerHTML = "Hi " + x ;
   }
 
  }

</script>
  </body>

</html>


Comments

Popular posts from this blog

HTML - Frameset Tag in html

Interface in TypeScript || Interface along with Arrow Function