What is data-toggle = "modal" used for?

I have a button code that someone created. Here is the button code:

<button class="demo btn btn-primary" data-toggle="modal" href="#long" onClick="javascript:add();"><i class="icon-plus-sign icon-white"></i> Add Employee</button> 

I edited the function associated with the button (send new data from the button and call it in the function), but nothing happened. Then I tried to remove data-toggle="modal" , the popup did not show. So, I wonder what to use data-toggle="modal" for?

I thought this was a link to modal:

 <script src="js/bootstrap-modalmanager.js"></script> <script src="js/bootstrap-modal.js"></script> 

Can someone explain to me about data-toggle="modal" ? Thanks.

+6
source share
1 answer

In Download Documents

 <!--Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.--> <button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button> 
+14
source

Source: https://habr.com/ru/post/971264/


All Articles