title: Can I set a data attribute on bootstrap 5 modal button in modal footer? Below is my attempt and it's failing
body: <p>I'm trying to set a data attribute on a button in a BS5 modal footer so I can pass that information to an AJAX function. I can set the value of the button, but cannot get the data attribute to update.</p>
  <p>JavaScript code:</p>
  <pre><code>$('.soldVehicle').on('click', function() {
      var thisID = $(this).data('id');
      var thisName = $(this).data('name');
      $('#soldModal #vDetails').html(thisName);
      soldModal.show();
  });
  $('#soldModal').on('shown.bs.modal', function(event) {
      var btn = $('.soldVehicle');
      var vID = btn.data('id');
      var modal = $(this);
      modal.find('#soldVehicle').data('id', vID);
  });
  </code></pre>
  <p>Modal Code:</p>
  <pre><code>&lt;div class=&quot;modal fade&quot; id=&quot;soldModal&quot; tabindex=&quot;-1&quot; aria-labelledby=&quot;soldModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;div class=&quot;modal-dialog modal-dialog-centered&quot;&gt;
      &lt;div class=&quot;modal-content&quot;&gt;
        &lt;div class=&quot;modal-header&quot;&gt;
          &lt;h5 class=&quot;modal-title&quot; id=&quot;soldModalLabel&quot;&gt;MARK VEHICLE AS SOLD&lt;/h5&gt;
          &lt;button type=&quot;button&quot; class=&quot;btn-close&quot; data-bs-dismiss=&quot;modal&quot; aria-label=&quot;CANCEL&quot;&gt;&lt;/button&gt;
        &lt;/div&gt;
        &lt;div class=&quot;modal-body&quot;&gt;
          &lt;p&gt;Do you want to mark the following vehicle as sold?&lt;/p&gt;
          &lt;div id=&quot;vDetails&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;modal-footer&quot;&gt;
          &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-bs-dismiss=&quot;modal&quot;&gt;CANCEL&lt;/button&gt;
          &lt;button id=&quot;soldVehicle&quot; type=&quot;button&quot; class=&quot;btn btn-agency&quot; data-id=&quot;&quot;&gt;SOLD IT!&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Is this possible or do I need to settle for setting the value attribute?</p>