Copy a custom component created with personalized HTML

@david.wylie see comments below! :smiley:

as the widget’s docs say I must

Do you mean the Anvil docs? Sounds like a bit that might need improving, do you remember where?

If I want to have multiple instances of this custom component on the same Anvil form, then each ID has to be globally unique, yes?

Yes, you shouldn’t use duplicate IDs in any HTML according to the HTML spec.

Your example @shaun is using dom classes instead of IDs. I assume I cannot “bury” duplicate IDs inside a class instance?

Can you describe more specifically how this would work? I’m not quite picturing it.

Is there a better way than mine when you require IDs for the widgets?

What are you using the IDs for? (Assuming you’re able to divulge!)

The $(this).find('.bob')[0] approach might be the way to go - if you need to select the element from outside, you might be able to write an accessor function in the Custom HTML Form (@jshaffstall - that may work for you too?) .