|
|||||||
Strategy
1. Add the radio buttons and the additional text field. Your UI should look something like:
2. The prices are as follows: child ($5), adult ($10), senior ($7). When the "Purchase" button
is clicked, the price will be shown to the user. See below:
3. Now use the fact that you know which radio button is activated to set the price. If you
decided to do method (b), you should store the price in the value attribute of the radio buttons,
that way, when you find that a radio button is checked, then you know the price is in
4. Now make it so that the Purchase button event handler will also take into account the number in the "How many" box. See the sentence generator example in the slides (slide #11 and slide #12). You'll have to save your message in a variable and then continually add it to another variable. That's it! The code to the event handler should be around 15 - 20 lines long. If you do not do the if statement in the for loop for checking the radio buttons, your solution will be around 25 - 30 lines long. As always, think before you type! Grading criteriaIn addition to accomplishing the tasks specified, your HTML file must validate! Submissions instructionsTurn in lab8.html and lab8.js here.
|
|