I am trying to add an onClick handler in insertAdjacentHTML method but getting SyntaxError: Function statements require a function name
error, I have set a console log, it should show the console value but it throws the error,
Am I missing anything?
document
.querySelector(`[data-msgid="${view.id}"] .chat-msg__message`)
?.insertAdjacentHTML(
'beforeend',
`<div class="daisy-dropdown daisy-dropdown-end">
<button tabindex="0" type="button">
<i class="fa fa-bars ml-2"></i>
</button>
<div tabindex="0" class='${[
'daisy-dropdown-content',
'daisy-menu',
].join(' ')}'>
<button onclick=${() => console.log('click')}>Kick</button>
</div>
</div>`
);