title: Show variable outside for loop shopify
body: <p>I am trying to show the selected value in Shopify outside the for loop. 
  How do I show the selected radio option in the label after "Color:"? I want to display it where it says "SHOW SELECTED OPTION".</p>
  
  <p>Does anyone know how to solve this?</p>
  
  <pre><code>&lt;label&gt;Color: SHOW SELECTED OPTION&lt;/label&gt;
  
  &lt;fieldset class="single-option-color-selector"
    id="ProductSelect-option-{{ forloop.index0 }}"&gt;
    {% assign option_index = forloop.index %}
    {% for value in option.values %}
      {% assign variant_label_state = true %}
      {% if product.options.size == 1 %}
        {% unless product.variants[forloop.index0].available  %}
          {% assign variant_label_state = false %}
        {% endunless %}
      {% endif %}
      &lt;input type="radio"
        {% if option.selected_value == value %} checked="checked"{% endif %}
        value="{{ value | escape }}"
        data-index="option{{ option_index }}"
        name="color"
        class="single-option-selector__radio"
        id="ProductSelect-option-{{ option.name | handleize }}-{{ value | escape }}"&gt;
      &lt;label class="option-color-{{ value | escape }}" for="ProductSelect-option-{{ option.name | handleize }}-{{ value | escape }}" title="{{ value | escape }}"&gt;{{ value | escape }}&lt;/label&gt;
    {% endfor %}
  &lt;/fieldset&gt;
  </code></pre>