title: Javascript set timeout to bootstrap alert
body: <p>My alerts are dynamically created.</p>
  
  <p>Is it possible to assign a function to the alert to self destroy in 3 seconds?</p>
  
  <pre><code>{% if messages %}
      {% for message in messages %}
          &lt;div class="alert alert-{{ message.tags }}"&gt;  
              &lt;a class="close" data-dismiss="alert"&gt;×&lt;/a&gt;
              {{ message }}
          &lt;/div&gt;
      {% endfor %}
  {% endif %}
  </code></pre>
  
  <p>I am using <code>Django</code> as a backend.</p>
  
  <p>The end product looks like this</p>
  
  <pre><code>&lt;div class="alert alert-success"&gt;
      &lt;a class="close" data-dismiss="alert"&gt;×&lt;/a&gt;
      My message
  &lt;/div&gt;
  </code></pre>
  
  <h1>Summary</h1>
  
  <p>Is it possible to make a timeout function like</p>
  
  <pre><code>setTimeout(function(this){ $(this).remove() }, 3000);
  </code></pre>
  
  <p>into the tags?</p>