通过jquery动态添加按钮来引导模态页脚

时间:2017-05-15 20:32:18

标签: javascript jquery twitter-bootstrap modal-dialog

我正在尝试动态地向引导模式的页脚添加一个按钮。 那可能吗?找不到它。

<div class="modal fade" id="myModalRead" 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">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel"></h4>
              </div>
              <div class="modal-body"><p id="myModalBody"></p>
               </div>
              <div class="modal-footer"  id="myModalFooter" >
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
          </div>
        </div>

例如这个按钮:

> <button type="button" class="btn btn-default btn-ok"
> data-dismiss="modal">Delete or whatever</button>

jquery的:

 jQuery(function($) {       
$("#myModalBody").html(text);           
$("#myModalRead").modal('show');
    });

有点

  

$( “#myModalFooter”)addabutton();

0 个答案:

没有答案