Home › Forums › General Issues › Unique ID / Class from ACF › Reply To: Unique ID / Class from ACF
Hi @emaildano
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.
Thanks
E
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.