/* signature: sayMagicWord: void -> void purpose: expects nothing and returns nothing, but has the side-effect of causing a pop-up saying "PLEASE!" to appear adapted from: "Web Programming Step by Step", Stepp, Miller, Kirst, pp. 235-238 adapted by: Sharon Tuttle last modified: 2-20-13 */ function sayMagicWord() { // grab the textfield object for the // textfield with id enteredName var nameField = document.getElementById("enteredName"); // if this textfield is not empty, use it to customize a plea // in an alert pop-up (otherwise, use a default plea) if (nameField.value === "") { alert("PLEASE to unknown person!"); } else { alert("PLEASE! " + nameField.value); } }