2023-12-22 09:13:53 +01:00
---
title: Webflow
---
2023-05-17 10:00:25 +02:00
Head over to the Share tab of your bot and click on the Webflow button to get the embed instructions of your bot.
## Advanced guides
### Trigger a typebot command on a click of a button
1. Head over to the `Settings` tab of your button and add a dedicated `ID`
2023-05-23 18:01:49 +02:00
2. In your typebot `Embed` element, insert this code in the existing `<script>` tag:
```js
document.getElementById('BUTTON_ID').addEventListener('click', (event) => {
event.preventDefault()
Typebot.open()
})
```
You can add as many as you'd like if you need to open the bot on several button clicks
It should look like:
2023-05-17 10:00:25 +02:00
```html
<script type="module">
2024-06-26 10:13:38 +02:00
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.3/dist/web.js'
2023-05-17 10:00:25 +02:00
Typebot.initPopup({
typebot: 'my-typebot',
})
2023-05-23 18:01:49 +02:00
document.getElementById('BUTTON_ID_1').addEventListener('click', (event) => {
event.preventDefault()
Typebot.open()
})
document.getElementById('BUTTON_ID_2').addEventListener('click', (event) => {
2023-05-17 10:00:25 +02:00
event.preventDefault()
Typebot.open()
})
</script>
```
2023-05-23 18:01:49 +02:00
Make sure to replace `BUTTON_ID_1` and `BUTTON_ID_2` with the ID you added on your button elements.
2023-05-17 10:00:25 +02:00
2023-12-22 09:13:53 +01:00
In this example we are opening the popup when the specified buttons are clicked but you could also use any of the [available commands](./libraries/html-javascript#commands).