Dynamically add a webflow event (or create a dropdown)

Let’s say you clone a webflow dropdown element. The events won’t be attached to it. How does one attach the proper webflow events, so that when you click the dropdown, it opens.

thx!

Hi @gidonwise Welcome to the community! :smiley:

All “events” (aka interactions) are also copied to your clipboard. No need to “re-attach” them when pasting it.

I am creating the element using my own custom javascript. I’m not using the webflow editor.

Thanks for the welcome!

Hi @gidonwise - Were you able to resolve this? I have a similar issue.

Most of the webflow.js modules can re-initialized.
This is a guess but I’d try this after you’ve created your JS-cloned dropdown component.

Webflow.require('dropdown').ready();