Home › Forums › General Issues › Unique ID / Class from ACF › Reply To: Unique ID / Class from ACF
Is this on the front end in a template?
Is the JS inline with the template?
You can create a unique ID from many things such as the time, name or even field value. If both the HTML and JS are being generated in the same file, you can match the ‘selector’ quite easily.
I prefer to use the function
uniqid – which will give you a very unique number.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.