Passing data to a bootstrap modal

后端 未结 12 1924
心在旅途
心在旅途 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 14:00

    Your code would have worked with correct modal html structure.

    $(function(){
      $(".open-AddBookDialog").click(function(){
         $('#bookId').val($(this).data('id'));
        $("#addBookDialog").modal("show");
      });
    });
    
    
    
    
    
    
    Open Modal
    
    
    

提交回复
热议问题