Working with Checkboxes, Radio Buttons, and Dropdowns
What problem does this code solve for dynamic select elements?
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.type === 'childList') {
updateSelectUI(mutation.target);
}
});
});
observer.observe(select, { childList: true });