Topic: Error displaying a bootstrap component with JQuery innerHTML or html to add content dynamically

Antons free asked 1 year ago

Why when adding a mdbootstrap component via JQuery's innerHTML or html, does the functionality of the components not work despite the redundancy?

In the previous example, a component of the treeview plugin is loaded through innerHTML and the functionality when clicking on the drop-down elements does not work, I attach an example of the code used, additionally I have already tried other components of mdbootstrap for example: select, input, among others

enter image description here

Kamila Pieńkowska staff answered 1 year ago

Components with HTML auto init are initiated on the initial page load.

If you add components dynamically you need to init them with js or jQuery after they are added.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 6.1.0
  • Device: PC HP
  • Browser: Google Chrome, Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No