title: data-target button attribute change via vanilla javascript
body: <p>Ive got button that is closing bootstrap modal as below:</p>
  
  <pre><code>&lt;button id="back_offer_button" type="button" class="btn btn-default" data-dismiss="modal" data-toggle="modal" data-target="#addOffer"&gt;Go back&lt;/button&gt;
  </code></pre>
  
  <p>I want to be able to dynamic change data-target via vanilla javascript to different location:</p>
  
  <p>For example now is </p>
  
  <pre><code>data-target="#addOffer"
  </code></pre>
  
  <p>I want to change it to </p>
  
  <pre><code>data-target="#addDifferentOffer"
  </code></pre>
  
  <p>So I tried to get this button:</p>
  
  <pre><code>var backOfferButton = document.getElementById('back_offer_button');
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>backOfferButton.data-target = "#addDifferentOffer" &lt;?&gt;
  </code></pre>
  
  <p>This of course doesn't work. How should it be written correctly? </p>