I have implemented a modal in my tutorial project using the bootstrap modal class. However, when I click on the "Add Post" button, nothing happens and I am unable to identify the issue. I have included $("[data-toggle='modal']").modal(); in my script as well.
If anyone has any insights into what might be causing the problem, please feel free to suggest a solution.
Here is a snippet of my code:
<!DOCTYPE html>
<html lang="en">
<head>
...
</head>
<body>
<!-- HEADER -->
...
<!-- ACTIONS -->
...
<a href="#" class="btn btn-primary btn-block"data-toggle="modal"data-target="#addPostModal"><i class="fas fa-plus"></i> Add Post</a>
...
<!-- MODALS -->
<!-- ADD POST MODAL -->
...
<div class="modal fade" id="addPostModal">
...
<button class="btn btn-primary" data-dismiss="modal">Save Changes</button>
...
</div>
...
<!-- FOOTER -->
...
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
...
<script>
$("#year").text(new Date().getFullYear());
$("[data-toggle='modal']").modal();
CKEDITOR.replace("editor1");
</script>
</body>
</html>