@david.wylie see comments below!
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?) .