How can I adjust JS to change text based on radio input variant?

Hello,

i change my variant option from select/option to radio input buttons.

When i used to select X variant with the select option i had a js that change text from div class, now that i change it to radio input buttons the script isnt working anymore, i tried to change it but i failed.

Can someone help me on it please.

 

 {% for option in product.options_with_values %}
                
                    

                        

                        
                             
                        

                          {% assign option_position = forloop.index %}
                          
                            
                                {%- for value in option.values -%}
                                
                                    

                                        - 
                            

                    
                            
                        {%- endfor -%}

Hi @Cpuga ,

Hard to read the code without seeing it. You have multiple errors in your code. You have to know when to use input-label and make use of the value. Your hideNotAvailableVariant function need to show and hide, but you are writing a code to change the text