onclick attribute or a custom JavaScript event tied to a button ID.To trigger a Calendly embed popup from a Webflow button using an onClick event, you must ensure the following conditions are met: Calendly’s embed script is added correctly, and your button contains the proper trigger code. If it's not working, it's likely due to a missing script or misconfigured custom attribute.
</body> tag:
https://assets.calendly.com/assets/external/widget.js
<script src="https://assets.calendly.com/assets/external/widget.js" type="text/javascript" async></script>
onclickCalendly.initPopupWidget({url: 'https://calendly.com/YOUR_USERNAME'});return false;
https://calendly.com/YOUR_USERNAME with your actual Calendly booking link.
onclick Attribute
If using the onclick attribute doesn’t work (due to Webflow stripping certain attributes), you can use an Embed element or Page Footer Custom Code:
open-calendly.<script> tag (remove angle brackets in Webflow editor):
`document.getElementById('open-calendly').addEventListener('click', function(e) {
e.preventDefault();
Calendly.initPopupWidget({ url: 'https://calendly.com/YOUR_USERNAME' });
});`
To launch a Calendly popup from a Webflow button, ensure the Calendly embed script is included in your footer, then trigger the popup using either the onclick attribute or custom JavaScript linked to your button ID. Always publish the site to see the changes take effect.