I am trying to use the start button to pull up a new screen with another button. This is the code I am using (minus the background URLs).
<button type="button" onclick="myFunction()">Start</button>
<script>
function myFunction() {
document.body.style.backgroundColor = "#f3f3f3";
document.body.style.backgroundImage = "url('example')";
<button type="button" onclick="NewFunction()">Other</button>
}
<script>
function NewFunction(){
document.body.style.backgroundImage = "url('example2')"
}
</body>
</html>
I have tried using an if statement to determine if myFunction has been executed, and adding the button if the conditions are met.
NewFunctionin the HTML part of the code, not within the<script>tags<button type="button" onclick="NewFunction()">Other</button>is likely causing an error in your script; you'll need to create an element and append it to something that already exists in your DOM.