Modal button not working when following this Flask tutorial. Please help!
I'm following a Flask tutorial on YouTube and have hit a point where I can't get the code to work. The button doesn't pop up when I click on it. Any ideas? I have tried switching "data-toggle" to "data-bs-toggle" and likewise for "dismiss" and "target" (in line with bootstrap 5) but it doesn't work. The button doesn't do anything at all when I click on it.
Here's the button:
<button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal" data-target="#deleteModal">Delete</button>
And here's the modal:
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete Post?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
/r/flask
https://redd.it/1f5xqyf
I'm following a Flask tutorial on YouTube and have hit a point where I can't get the code to work. The button doesn't pop up when I click on it. Any ideas? I have tried switching "data-toggle" to "data-bs-toggle" and likewise for "dismiss" and "target" (in line with bootstrap 5) but it doesn't work. The button doesn't do anything at all when I click on it.
Here's the button:
<button type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal" data-target="#deleteModal">Delete</button>
And here's the modal:
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete Post?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
/r/flask
https://redd.it/1f5xqyf
YouTube
Flask Tutorials
Python Flask Tutorials. In this series, we will be learning how to build a full-feature Flask application for scratch. We will learn how to get started with ...