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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.