Using Chrome Developer Tools one can select an HTML element and tell the debugger to break whenever this element's attributes get modified. How can I set such breakpoint for an element that gets injected into the DOM dynamically? I have an XPath query that matches this specific element, and I want the debugger to break as soon as this element's attributes are changed.
I tried this approach:
- Put a breakpoint just after the element is created.
- Configure the dev tools to break on attribute change (for the newly created element)
It works, but it is very inconvenient and I wonder if there is a better option.
BTW, I don't mind using Firefox developer tools or any other tool if it lets me do that.