Example code for making an alter box


<!DOCTYPE html>
<html>
<body>
<p>Click the button to demonstrate the prompt box.</p>

<button onclick="myFunction()"> Hello! </button>

<p id="demo"></p>

<script>
function myFunction() {
var person = prompt("Please enter your name", "Winnie the Pooh");
if (person != null) {
document.getElementById("demo").innerHTML ="Hello " + person + "! Welcome to NameOfYourRecipe ! ";
}
}
</script>
</body>
</html>


Demo

Back to the Intro Page