Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function checkPhoneInput() {
- var phoneNumberInp1 = document.querySelector('#phoneNumberCtrl');
- if (phoneNumberInp1 && !window.phoneNumberInpExist) {
- window.phoneNumberInpExist = true;
- observer.disconnect();
- phoneNumberInp1.addEventListener('input', function() {
- window.localStorage.setItem('ADORIC_userPhone', phoneNumberInp1.value);
- });
- }
- }
- var targetNode = document.querySelector('body');
- var config = {
- attributes: true,
- childList: true,
- subtree: true
- };
- var callback = function(mutationsList, observer) {
- for (var i=0; i < mutationsList.length; i++) {
- if (mutationsList[i].type === 'childList') {
- checkPhoneInput();
- }
- }
- };
- var observer = new MutationObserver(callback);
- observer.observe(targetNode, config);
- })();
- </script>
Add Comment
Please, Sign In to add comment