Select tags
360 likes | 375 Vues
Select tags. Design of a page that have the user guess the author of a quote (QuoteQuizDesign.htm). Place the cursor in the cell after the first quote and double click the Select item from the Toolbox. Right click on the select element and choose Properties.
Select tags
E N D
Presentation Transcript
Design of a page that have the user guess the author of a quote (QuoteQuizDesign.htm).
Place the cursor in the cell after the first quote and double click the Select item from the Toolbox.
When finished adding entries to the drop-down list, click OK.
In the select code generated, change the id attribute to something meaningful.
Add a button to the last column of the first row. Change id and value.
Add an argument/parameter to the function. I added this 1 to refer to the question number. Instead of sending an id, I will construct the id from the number.
Concatenated id Note how in the argument of the getElementById method, we get a specific id for a drop-down list by concatenating “selQuote” and the number sent when the function was called.
Result of clicking first button – gives the value “MT” assigned to the Mark Twain option.
Add disabling code for both the button and the drop-down list (select element).
Declare variable for user’s selection/answer. Use if to compare answer to user’s answer. If user’s answer and the answer are NOT equal, then change value of button to “No”
Finish the quiz; the answers are: • OW • BF • BF • MT • OW • OW • MT • MT
References • www.quoteland.com