Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
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">&times;</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