twitter bootstrap modal — how to pass data to callback function

前端 未结 3 1090
忘了有多久
忘了有多久 2021-01-26 05:18

is there a way to pass additional data to bootstrap modal function callback?

for example, lets say my link that causes the modal to open has an extra attribute in it wit

3条回答
  •  梦谈多话
    2021-01-26 05:54

    Like this -

     Edit Task List
    
    $('#modal_opener').click(function() {
        var stuff_i_want = $(this).attr('data-extrastuff');
    });
    

提交回复
热议问题