Display HTML using .this

Hello,

I'm attempting to output HTML element onto DOM depending on user input (click). Here is sample code:

const main = document.querySelector("main")
const buttons = document.querySelectorAll("main button")

buttons.forEach(btn => {
    btn.addEventListener("click", findWinner)
});

function findWinner() {
  main.innerHTML = this
}


When running this code, I get this output on page [object HTMLButtonElement], however, if I change this to this.innerHTML, I get the children of the element without the parent. How do I go about outputting the entire HTML of the button?
Was this page helpful?