Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var target = document.querySelector('.search-box');
-
- // create an observer instance
- var observer = new MutationObserver(function (mutations) {
- console.log(mutations);
- $('#search-dropdown').val('');
-
- });
-
- // configuration of the observer:
- var config = {
- attributes: true,
- childList: true,
- characterData: true,
- attributes: true,
- attributeOldValue: true,
- attributeFilter: ['class']
- };
-
- // pass in the target node, as well as the observer options
- observer.observe(target, config);
Add Comment
Please, Sign In to add comment