JavaScript not being indexed

Hello. I am having issues with the theme not applying my JavaScript code. Upon testing it in the console on the corresponding page, it works perfectly. Upon applying it in Theme Options > Custom JS, it seems to not even index it.
Please advise further on how should this be resolved. Regards, Ioan

Comments

  • Hi, we do not know what custom JS are you inserting to your custom JS but we can assure that it works fine. How can it be not indexing when it is in the page code?
    thanks
  • var dollarSing = document.querySelectorAll('p#wrdpress_pkg>span');
    for(i = 0; i < dollarSing.length; i++) {
    dollarSing[i].style.display = "none";
    }

    var dollarTwo = document.querySelectorAll('.price>span');

    for(i = 0; i< dollarTwo.length; i++){
    dollarTwo[i].style.display = "none";
    }

    var couponBox = document.querySelector('.reo-coupon-box');
    var formSubmit = document.querySelector('.submit-opts-form');
    couponBox.appendChild(formSubmit);


    As you can see, it is perfectly valid JavaScript and DOM manipulation.
    Upon pasting this code in the console, it works perfectly. The moment it is applied in Custom JS, it is as it was never written. You can see for yourselves on this page: https://thewebprestige.com/reach-us/

    If needed I will cooperate further, but has to be resolved in one way or another.
  • Theme is adding the custom JS correctly: https://pasteboard.co/GXefbVu.png
    The problem is that you have erros in your code: https://pasteboard.co/GXefT2b.png
Sign In or Register to comment.