Jordan M. Baron Jordan M. Baron - 1 year ago 50
HTML Question

Bootstrap 3 modal not working on button click

I made a simple modal following a tutorial and when I click the button the modal does not show up. I tried changing

but that din't fix the problem. The code below is the modal code. I have nothing in my CSS or JavaScript file.

<a data-target="#myModal" role="button" class="btn btn-warning" data-toggle="modal"><span class="glyphicon glyphicon-hand-up"></span>Sign up for weekly newsletter</a>

<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Sign up for the newsletter</h4>
<div class=modal-body>


Here's a CodePen:

Answer Source

In your head you need to have the following. Also remove the bootstrap links at the bottom of your body. Looks to me like you might have been running an outdated version of bootstrap js.

<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>

Here is a Codepen as an example.