Check out example codes for "targe id that starts with". It will help you in understanding the concepts better.

Code Example 1

[id^=product]

Learn ReactJs, React Native from akashmittal.com