In lab 4, we learned how to create an information form using JavaScript and we had to create a prompt box to show the results. Mrs. Ramirez helped us start off lab 4 by giving us the code. I added favorite activity, year you plan to get a car, and favorite food to my code. For this lab, we had to write JavaScript code inside our html document. In order to give someone their age, we had to use the code 'You are' + ' ' (document.informationform.data.value- document.informationform.birthday.value) + ' ' + 'yearsold'.
The "-" sign is used to minus the current year the person filled in and their year of birth to get their current age. After the person filled in the information, a prompt box pops up showing their first/last name, birthday, current year, favorite activity, in how many years they will get a car, and their favorite food. I can use this skill in the future to create an information form for a user to fill out.
The "-" sign is used to minus the current year the person filled in and their year of birth to get their current age. After the person filled in the information, a prompt box pops up showing their first/last name, birthday, current year, favorite activity, in how many years they will get a car, and their favorite food. I can use this skill in the future to create an information form for a user to fill out.
No comments:
Post a Comment