I created a button where when clicked on creates another button but Iam not sure how to make an onclick event for that button
function boyFunction(){
var btn1 = document.createElement("BUTTON");
var x = document.createTextNode("basketball");
btn1.appendChild(x);
document.body.appendChild(btn1);
btn1.classList.add('btn1');
}
I want to be able to click the basketball button and have that button show an image