Custom JavaScript is not being executed when clicking the menu within the category
I have inserted some HTML elements through the custom JavaScript under UI builder settings, which its contents will be dynamically changed when entering the certain page of the menu. Initially, upon having the page loaded, the added elements are displaying.
However, when clicking one of the menu within the Category, the added HTML elements are not changing anymore. I assume its because the whole page is only loaded at the start of the app, while clicking one of the menu will only reload the content within the main tag.
I have tried in finding the approach to access the load event within this main tag, but have not been able to find it.
Can you assist in utilizing the addEventListener to detect the main tag content loaded each time clicking a new menu within the category to ensure that the HTML elements inserted through the custom JavaScript under UI builder settings keeps being updated?
