<HTML>
<BODY>
<FORM>
Enter Your Name: <INPUT TYPE=text NAME=userName VALUE="Name">
Enter Your Age: <INPUT TYPE=text NAME=userAge VALUE="12">
<INPUT TYPE=button VALUE="Check Age"
onClick='var status = (userAge.value >= 21) ? "an adult" : "a minor";
alert(userName.value + " is " + status + ".");'>
</FORM>
</BODY>
</HTML>
|