Hi! I have a script that generates a mission statement. I need the mission statement to come out in a separate window when the user clicks the button. Do you have any code that can help with this?
[code]<br><button id=”launch” class=”home-cta”>Create your mission statement!</button>
<div id=”story”>
<p></p>
<p> </p>
<script type=”text/javascript”>
window.onload = function () {
var word1 = document.querySelector(“#word1”);
var word2 = document.querySelector(“#word2”);
var word3 = document.querySelector(“#word3”);
var word4 = document.querySelector(“#word4”);
launch.addEventListener(“click”, writeStory, false);
function writeStory(){
var launchedStory = “”;
launchedStory += “<h3><p>Our mission is ” + word1.value + ” ” + word2.value + ” ” + word3.value + ” ” + word4.value + “</p> </h3>”;
story.innerHTML = launchedStory;
}
}
</script>
</div>
<br>
</script>