title: Opening modal from function in pure javascript
body: <p>I want to open a modal with a function in pure javascript (not jquery). </p>
  
  <p>Component from where i am calling function:</p>
  
  <pre><code>&lt;div class="col-sm-5 offset-sm-5" 
      style={{ bottom: "60px", marginBottom: "20px", marginTop: "23px" }}&gt;
      &lt;button class="btn btn-primary btn-sm" onClick={this.handleSubmit.bind(this)}&gt;Save&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Function code:</p>
  
  <pre><code>handleSubmit=()=&gt;{
      document.getElementById('exchangehouse').style.display = "block"    
  }
  </code></pre>
  
  <p>Modal code:</p>
  
  <pre><code>&lt;div class="modal fade" id="exchangehouse" tabindex="-1" role="dialog" 
      aria-labelledby="exampleModalLongTitle" aria-hidden="true"&gt;
      &lt;div class="modal-dialog" role="document"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;h5 class="modal-title" id="exampleModalLongTitle"&gt;Modal title&lt;/h5&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                      &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  ...
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-secondary" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks</p>