Prompt Dialog Box in JavaScript

The prompt dialog box is very useful when you want to pop-up a text box to get user input. Thus it enable you to interact with the user. The user needs to fill in the field and then click OK.


	function functionP() 
		var x = prompt("enter anything"); // displays prompt
		alert(x); // displays input value in alertbox

	<button value="Back" onclick="functionP()">
		Click Here 




You may also like...