var elem = document.getElementById("Age"); if (elem != null) alert("You entered " + elem.value + " into the Age text box.");