The goal of this exercise is to make a Mad Libs generator.
The second half of these slides may be useful.
Start with this webpage, which has several input elements and a button:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
- Add a script tag to the bottom of the page for your code.
- Add an event listener to the button so that it calls a
makeMadLib
function when clicked. - In the
makeMadLib
function, retrieve the current values of the form input elements, make a story from them, and output that in the story div (like “Pamela really likes pink cucumbers.”)