Passing data to a bootstrap modal

后端 未结 12 1765
心在旅途
心在旅途 2020-11-21 13:10

I\'ve got a couple of hyperlinks that each have an ID attached. When I click on this link, I want to open a modal ( http://twitter.github.com/bootstrap/javascript.html#modal

12条回答
  •  -上瘾入骨i
    2020-11-21 13:46

    Try with this

    $(function(){
     //when click a button
      $("#miButton").click(function(){
        $(".dynamic-field").remove();
        //pass the data in the modal body adding html elements
        $('#myModal .modal-body').html('') ;
        //open the modal
        $('#myModal').modal('show') 
      })
    })
    

提交回复
热议问题