为什么未在锚点<a> tag?

时间:2018-06-24 23:51:20

标签: javascript jquery html

I have a icon of plus + sign which is supposed to open a modal form on click but here modal form is not opening.

<td>
    <a data-target="#myModal" data-toggle="modal" href="#myModal">
    <span class="glyphicon glyphicon-plus"></span></a>
    </p> 
</td>

Above code represent + sign and click on it.

Model Form code is below:

<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Modal Header</h4>
     </div>

     <div class="modal-body">
         <p>Some text in the modal.</p>
      </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-default" data- 
  dismiss="modal">Close</button>
  </div>
</div>

What's wrong with it. I am unable to find it. Any help would be appreciated

1 个答案:

答案 0 :(得分:0)

bootstrap.js库必须包括在内,以便data-toggle工作。