Hello Community - We are using HTL Use-API to get the cookie value from the script and printing the value in the component. For some reason, it is not working as expected and it retains the previous selected value. AEM document says "Use-API" could be slower.
Is there any way to use the return value from a java-script to the data-sly-test attribute?
I'd recommend following the fully front-end approach here - to move retrieval of cookies to JS stored in a clientlib. After the value is retrieved, it can be appended to necessary html element as described here https://api.jquery.com/append/