You are adding a child element to "panel" via the template, subscribing to click on that child, and then you are overwriting that element using innerHTML. Since the element is gone, there's nothing to trigger the onclick.

You are adding a child element to "panel" via the template, subscribing to click on that child, and then you are overwriting that element using innerHTML. Since the element is gone, there's nothing to trigger the onclick.