Looking for your help regarding this matter.
So the idea is to get a function which create button 'Click Again' upon clicking on the first created button "Submit". When I click on "Click Again",a greeting function is recalled which prints "Mission is Done!".
When testing my code, I get this error
Uncaught: ReferenceError: createdButton is not defined
function greet() {
console.log('Mission is Done!')
}
function addButton() {
const button = document.createElement('button')
const buttonTextNode = document.createTextNode('Click Again')
button.appendChild(buttonTextNode)
button.onclick = greet
document.body.appendChild(button)
}