title: How can I show/hide a bootstrap spinner with jQuery?
body: <p>I'm trying to show a bootstrap spinner after a click on a button and then hide it after getting a response from an API (basically a loading status).</p>
  
  <p>My button is as follow:</p>
  
  <pre><code>&lt;div class="col-6"&gt;
      &lt;button type="button" name="btn-enviar" class="btn btn-primary w-100"&gt;
      &lt;span class="spinner-border spinner-border-sm mr-3" id="spinner" role="status" aria-hidden="true"&gt;
      &lt;/span&gt;Enviar&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So far I've tried to comment/uncomment my span tag with no luck, there would be an easier way to start/stop my spinner?</p>
  
  <p>My comment/uncomment functions which I took from <a href="https://stackoverflow.com/questions/15553531/jquery-comment-uncomment-element">here</a> and are not working (as requested):</p>
  
  <pre><code>function comment(element) {
      element.html('&lt;!--' + element.html() + '--&gt;')
  }
  
  function uncomment(element) {
      element.html(element.html().substring(4, element.html().length - 3))
  }
  </code></pre>