When I dynamically add right html markup to the DOM bootstrap hooks up right plugin on new element. How does it do this?
If I have a markup
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li><a tabindex="-1" href="#">Action</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Separated link</a></li>
</ul>
Bootstrap will make from it dropdown element (hooks up dropdown plugin). How does it do it? Does it do it dynamically? (if I add markup during runtime?)
It does so by hooking to document ready event (or window load) and then either setting event listeners or initializing the components. For example, Affix plugin is being searched by its
data-spy="affix"attribute. As for Typeahead plugin, it gets initialized on first focus event.