Bootstrap : TypeError: $(…).modal is not a function

前端 未结 5 576
青春惊慌失措
青春惊慌失措 2020-12-17 10:15

i\'ve been trying to call bootstrap modal from jquery and keep getting this error message :

TypeError: $(...).modal is not a function

Here

5条回答
  •  失恋的感觉
    2020-12-17 10:46

    I had also faced same error when i was trying to call bootstrap modal from jquery. But this happens because we are using bootstrap modal and for this we need to attach one cdn bootstrap.min.js which is

    Hope this will help as I missed that when i was trying to call bootstrap modal from jQuery using

    $('#button').on('click',function(){ $('#myModal').modal(); });

    myModal is the id of Bootstrap modal and you have to give a click event to a button when you call click that button a pop up modal will be displayed.

提交回复
热议问题