I have incorporated a bootstrap tab on my website, which is generated dynamically through ajax requests.
While testing the static version of these tabs, everything was functioning perfectly. However, now that I am generating all tabs and panes dynamically, clicking on the tab does not set the 'show' attribute for its corresponding pane.
Since the content is added dynamically, the onclick event is created using .on('click', 'a'..)
Below is the code snippet...
I cannot seem to pinpoint what I am doing wrong in the generation process as the dynamic code mirrors the static one:
$('#tab').on('click', 'a', function(e) {
e.preventDefault()
$(this).tab('show');
})
...