Home > Enterprise >  Bootstrap 4 close button not working django
Bootstrap 4 close button not working django

Time:01-09

enter image description hereI have a close button on my alert but when I click on it it doesn't close. I have seen similar people with the same problem but none of the solutions have worked for me

This is what I currently have

{% for message in messages %}
<div >
  <div  role="alert">
    <button type="button"  data-dismiss="alert" aria-label="Close">
      <span aria-hidden="true">&times;</span>
    </button>
    {{ message }}
  </div>
</div>
{% endfor %}

CodePudding user response:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>


<div >Alert title is here <span  data-dismiss="alert">&times;</span></div>

Please check the code snippet and correct your code accordingly.

  • Related