how can i trigger typebot ,when we click a div - using JS

#help
2 Replies
Thasanthan_CodeThamizha
when i use Typebot.sendCommand(...) its not triggering! here is the code <script type="module"> import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0/dist/web.js'; document.addEventListener("DOMContentLoaded", function () { const card = document.querySelector('.eftpos-terminal'); // or use '#startChatCard' for ID
if (card) { card.addEventListener('click', function () { // Your custom action here' console.log('Card clicked!'); Typebot.sendCommand('eftpos-terminal');
// Example: trigger chatbot // window.TidioChatApi.open(); // (example for Tidio)
// Example: open a popup // document.getElementById("popup").style.display = "block"; }); } }); </script>
Baptiste
Baptiste2mo ago
What is your Typebot init function?

Did you find this page helpful?