title: data-toggle in javascript function
body: <p>I have a button with the code:-</p>
  
  <pre><code>&lt;button type="button" name="btn-success" data-toggle="modal" data-target="#exampleModal" class="btn-success"&gt;Process&lt;/button&gt;
  </code></pre>
  
  <p>with A Modal. </p>
  
  <p>Now I want to change the button like this </p>
  
  <pre><code>&lt;button type="button" name="btn-success" onclick="myFunction()" class="btn-success"&gt;Process&lt;/button&gt;
  </code></pre>
  
  <p>And I want <code>data-toggle="modal" data-target="#exampleModal"</code>
  to be executed in the function. </p>
  
  <p>I tried</p>
  
  <pre><code>&lt;script&gt;
      function myFunction(){
          data-toggle="modal" data-target="#exampleModal";
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>But it didn't work. Can anyone teach me how to do that?</p>