I tried to add the “onclick” attribute to a custom element in the properties tab, but when I publish the site and click on my element, nothing happens.
Am I missing something?
I’ve left more details in the Read-only link. I know some workarounds. I’m not trying to find one.
I thought it would be more powerful and easier to maintain to use Webflow’s custom element directly.
Custom attributes and custom elements are different things, in my experience standard elements with custom attributes are restricted, but the attributes that you create on custom elements had no obvious restrictions. “No restrictions” was essentially the point of custom elements.
You’re the first person I’ve seen that’s mentioned one.
I’d contact support- it could be a bug or the devs may have a rationale for why certain limits need to exist.
My best guess is that those attributes can potentially conflict with interactions, and that support was getting messages from confused users who had created conflicts, and then thought that interactions was broken.
In essence that’s possible because there are more “importers” now, where you can absorb an existing site’s HTML into Webflow in the form of a huge hierarchy of custom elements. Those on* attributes would be difficult to find and fix.