I am tryying around with a book called "Learn how to program". My first challenge came up when I put in the following code and gedit called the ">" an end of statement. It is this line "" onClick='var status = (userAge.value >=21) ? "an adult" "
Here is the code that is supposed let you type your age in a box to let you know if you are over or under 21.
*note: I am using gedit and Firefox in Linux Mint
<HTML>
<BODY>
<FORM>
Enter Your Name:
<INPUT TYPE=text NAME=UserName Value="Harry Potter">
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>
________________
sakibpavel
Here is the code that is supposed let you type your age in a box to let you know if you are over or under 21.
*note: I am using gedit and Firefox in Linux Mint
<HTML>
<BODY>
<FORM>
Enter Your Name:
<INPUT TYPE=text NAME=UserName Value="Harry Potter">
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>
________________
sakibpavel
Comment