//Create a story-telling program: // 1. Use the prompt() command several times to collect different types of words -- nouns, verbs, adjectives. // 2. Store the result of each prompt() command in a different variable. var adj = prompt("Give me an adjective!"); var noun = prompt("Give me a noun!"); var verb = prompt("Give me a verb!"); var name = prompt("Give me a name!"); // 3. Combine the variables with other strings to create one or more non-sensical statements. var story = "<h2>There once was a monkey named " + name + ", who loved to eat " + noun + " and " + verb + " in trees.</h2>"; // 4. Print the resulting story to the browser using the document.write() command. document.write(story);
Pretty basic stuff, but I did learn the document.write function and how to embed header tags in my app code file (vs. in the index.html file). I'm not sure if you're really "supposed" to do this, but previously I didn't even know it was possible.