How to get all variants value from the dropdown in Shopify?

First, create the dropdown and use Shopify filters.variants-value

Example :

<div class="single-option-selector" id="SingleOptionSelector" data-index="option{{ forloop.index }}">
   {% for value in option.values %}
     <input type="text" class="variant" value="{{ value | escape }}" {% if option.selected_value == value %} selected="selected"{% endif %} readonly>
   {% endfor %}
</div>

Then include the below script.

Example :variants-value

      $("select#SingleOptionSelector option").each(function(){
        var optionValue = $(this).val();
      });