I want to set the id
property of an input element of a form that I'm creating in a module using the form API. I'm doing this I looked up the documentation and it says this:
id
INTERNAL. Used to populate form elements' id property. In rare cases, you can set this value yourself on a form element, to override the default setting.
It doesn't really say when I can or can't use it, so I'm hesitant to try to do this, since I can't rely on it.
I'm writing some javascript that has the id of the element hard-coded into it. Should I use the Drupal-generated id in my script instead?