Select specific component with javascript

I have never found an easy way. See here: Add the component name to the HTML tag

One workaround that I sometime use is to put text_area_1 inside a container together with a label, make the label invisible and set its text to "text_area_1" (or any other unique string). Then javascript will look for a label with the text "text_area_1", get its parent, then its sibling and start from there.
It ain’t pretty and it’s brittle: I don’t know if the HTML structure of the components will change, but that’s the best solution that I have found so far.

2 Likes