Passing data to a bootstrap modal

后端 未结 12 1763
心在旅途
心在旅途 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条回答
  •  花落未央
    2020-11-21 13:52

    This is how you can send the id_data to a modal :

    
    
    

    And the javascript :

        $(function () {
         $(".modal-btn").click(function (){
           var data_var = $(this).data('some-id');
           $(".modal-body h2").text(data_var);
         })
        });
    

提交回复
热议问题