No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Component IDs
Local IDs
A local ID is unique within a component and is only scoped to the component.
Create a local ID by using the aura:id attribute. For example:
Find the button component by calling cmp.find("button1") in your client-side controller, where cmp is a reference to the component containing the button.
aura:id doesn't support expressions. You can only assign literal string values to aura:id.
Global IDs
Every component has a unique globalId, which is the generated runtime-unique ID of the component instance. A global ID is not guaranteed to be the same beyond the lifetime of a component, so it should never be relied on.
To create a unique ID for an HTML element, you can use the globalId as a prefix or suffix for your element. For example:
You can use the getGlobalId() function in JavaScript to get a component's global ID.
You can also do the reverse operation and get a component if you have its global ID.