Last active
March 12, 2021 06:07
-
-
Save bogoreh/589ee6eb8ec389183bc5044e7c828939 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Spin-off of "Challenge: Mad Libs"</title> | |
| </head> | |
| <body> | |
| <h1>Mad Libs</h1> | |
| <ul> | |
| <li>Noun: <input type="text" id="noun"></li> | |
| <li>Adjective: <input type="text" id="adjective"></li> | |
| <li>Someone's Name: <input type="text" id="person"></li> | |
| </ul> | |
| <button id="lib-button">Lib it!</button> | |
| <p>Generated story: | |
| <span id="story"></span> | |
| </p> | |
| <script> | |
| var libButton = document.getElementById('lib-button'); | |
| var libIt = function() { | |
| var storyDiv = document.getElementById("story"); | |
| var noun = document.getElementById("noun").value; | |
| var adjective = document.getElementById("adjective").value; | |
| var person = document.getElementById("person").value; | |
| storyDiv.innerHTML = noun+" noun "+adjective+" adjective "+ person; | |
| }; | |
| libButton.addEventListener('click', libIt); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment