Home › Forums › Feature Requests › Add CSS class to tabs › Reply To: Add CSS class to tabs
I think that field_key-field_554c7be3c5fb7
is the reference to the original field that’s being copied to the other languages, maybe even though you have German set as the default language there is another version of the field group that ACF is copying all the language field groups from. I could be wrong, but that’s what’s repeated in both tabs and my gut feeling is that’s the reason.
I’m just trying to figure out how to work with what’s already there. I like puzzles.
You can get this element, then get the data-key attribute from it and then you have what you need.
var tab_div = $('.field_key-field_554c7be3c5fb7');
var data_key = tab_div.getAttribute('data-key');
$('a[data-key="'+data_key+'"]').doSomething();
Or maybe you don’t even need to go that far, maybe using that class is enough to target what you need to.
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.