Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const target = document.querySelector('.search-box'),
- MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
- searchBoxObserver = new MutationObserver(mutationHandler),
- config = { attributes: true, attributeOldValue: true, attributeFilter: ['class'] };
- function mutationHandler (mutations) {
- mutations.forEach(function () {
- $('#search-dropdown').val('');
- });
- }
- searchBoxObserver.observe(target, config);
Advertisement
Add Comment
Please, Sign In to add comment