bootstrap 中的静态模式的控制按钮上的一个坑
在使用modal时发现,代码:<button class="btn btn-danger" data-toggle="modal" data-target="#myModal">删除</button>,button按钮点击没有反映,经过与自带的实例对比,发现一个区别,就是type="button"没有加,真是一个坑啊
<button class="btn btn-danger" type="button" data-toggle="modal" data-target="#myModal">删除</button> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div>