Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › JS/DOM issue after results are filtered in Elementor posts element. › Reply To: JS/DOM issue after results are filtered in Elementor posts element.
December 22, 2020 at 11:13 am
#30870
Keymaster
Hi,
When a DOM node changes, event handlers are usually not re-attached to the new set of items in the parent node. It is not the issue of either of the plugins. These codes will not work on any dynamically generated contents. It is possible to rewrite them in a different way, please check the Event binding on dynamically generated elements
In you case something like this may work:
jQuery('.elementor-element-42c810b').on('click', '.fly-pattern-btn', event => {
jQuery(event.currentTarget).next().toggle();
console.log('material stuff');
});