Hello,
I have successfully added button in my website which triggers a Klaviyo popup. Now I would like to add a second button but I see it is not triggering the popup. I think the issue is that the script listen to the first button only, so here is my question: how can I edit the script so that the popup is trigger by every buttons?
<button class="klaviyo_form_trigger">First button</button>
<button class="klaviyo_form_trigger">Second button</button>
<script type="text/javascript">
document.querySelector('.klaviyo_form_trigger').addEventListener('click', function (){
window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'FORM_ID']);
});
</script>