title: Change a button attribute value depending on selector option attribute
body: <p>I have the following selector with options:</p>
  <pre><code>&lt;select name=&quot;&quot; id=&quot;product-selector&quot; class=&quot;list_item&quot;&gt;
    &lt;option value=&quot;74552&quot; data-id=&quot;74552&quot; data-content=&quot;50 Items &lt;span class='price' data-count='50 Items' data-price='$20'&gt;$20&quot;&gt; &lt;/option&gt;
    &lt;option value=&quot;74553&quot; data-id=&quot;74553&quot; data-content=&quot;100 Items &lt;span class='price' data-count='100 Items' data-price='$30'&gt;$30&quot;&gt; &lt;/option&gt;
    &lt;option value=&quot;74554&quot; data-id=&quot;74554&quot; data-content=&quot;300 Items &lt;span class='price' data-count='300 Items' data-price='$45'&gt;$45&quot;&gt; &lt;/option&gt;
    &lt;option value=&quot;74555&quot; data-id=&quot;74555&quot; data-content=&quot;500 Items &lt;span class='price' data-count='500 Items' data-price='$60'&gt;$60&quot;&gt; &lt;/option&gt;
    &lt;option value=&quot;74556&quot; data-id=&quot;74556&quot; data-content=&quot;1000 Items &lt;span class='price' data-count='1000 Items' data-price='$100'&gt;$100&quot;&gt; &lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>And I have the following button:</p>
  <pre><code>&lt;a role=&quot;button&quot; aria-label=&quot;Add to Wishlist&quot; class=&quot;tinvwl_add_to_wishlist_button&quot; data-tinv-wl-product=&quot;2050&quot; data-tinv-wl-productvariation=&quot;74552&quot; data-tinv-wl-productvariations=&quot;[74552]&quot; data-tinv-wl-producttype=&quot;variation&quot; data-tinv-wl-action=&quot;addto&quot;&gt;&lt;span class=&quot;tinvwl_add_to_wishlist-text&quot;&gt;Add to Wishlist&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  <p>How can I ensure that when an option is selected, the <strong><code>data-tinv-wl-productvariation</code></strong> attribute in the button changes its value depending on the <strong><code>data-id=</code></strong> attribute of the selected option?</p>
  <p>As an example, if I selected the option:</p>
  <pre><code>&lt;option value=&quot;74553&quot; data-id=&quot;74553&quot; data-content=&quot;100 Items &lt;span class='price' data-count='100 Items' data-price='$30'&gt;$30&quot;&gt; &lt;/option&gt;
  </code></pre>
  <p>with <strong><code>data-id=&quot;74553&quot;</code></strong></p>
  <p>my button takes its value and transforms into the following:</p>
  <pre><code>&lt;a role=&quot;button&quot; aria-label=&quot;Add to Wishlist&quot; class=&quot;tinvwl_add_to_wishlist_button&quot;  data-tinv-wl-product=&quot;2050&quot; data-tinv-wl-productvariation=&quot;74553&quot; data-tinv-wl-productvariations=&quot;[74553]&quot; data-tinv-wl-producttype=&quot;variation&quot; data-tinv-wl-action=&quot;addto&quot;&gt;&lt;span class=&quot;tinvwl_add_to_wishlist-text&quot;&gt;Add to Wishlist&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  <p>I tried to try various options, but temporarily due to lack of knowledge and experience, I cannot write the correct script.</p>