HTML
<button id="showStoryButton">Show story</button> <p id="storyParagraph"></p>
JavaScript
let storyButton = document.getElementById(`storyButton`) let storyParagraph = document.getElementById(`storyParagraph`) storyButton.addEventListener(`click`, showStory) function showStory() { storyParagraph.innerHTML = `The dog jumped over the fence.` }
Reason
HTML
<button id="storyButton">Show story</button> <p id="storyParagraph"></p>
JavaScript
let storyButton = document.getElementById(`storyButton`) let storyParagraph = document.getElementById(`storyParagraph`) storyButton.addEventListener(`click`, showStory) function showStory() { showStoryParagraph.innerHTML = `The dog jumped over the fence.` }
Reason
HTML
<button id="storyButton">Show story</button> <p id="storyParagraph"></p>
JavaScript
let storyButton = document.getElementById(`storyButton`) let storyParagraph = document.getElementById(`storyParagraph`) function showStory() { storyParagraph.innerHTML = `The dog jumped over the fence.` }
Reason
HTML
<button id="storyButton">Show story</button> <p id="storyParagraph"></p>
JavaScript
let storyButton = document.getElementById(`storyButton`) let storyParagraph = document.getElementById(`storyParagraph`) storyButton.addEventListener(`click`, showStory) function tellStory() { storyParagraph.innerHTML = `The dog jumped over the fence.` }
Reason
HTML
<button id="showStory">Show story</button> <p id="storyParagraph"></p>
JavaScript
let showStory = document.getElementById(`showStory`) let storyParagraph = document.getElementById(`storyParagraph`) showStory.addEventListener(`click`, showStory) function showStory() { storyParagraph.innerHTML = `The dog jumped over the fence.` }
Reason