Skip to main content
1 of 2
aebabis
  • 443
  • 5
  • 11

##Javascript var button = document.createElement('button'); button.addEventListener('click', document.createElement); window.onerror = setTimeout.bind(window, button.click); button.click();

Explanation: document.createElement() expects a parameter, so clicking the button causes an error to be thrown. The window catches the error and dispatches another click to the button. I don't think this meets the definition of recursion provided since the browser's event loop is invoking the error handler.

aebabis
  • 443
  • 5
  • 11