class="no-js" but javascript is working WordPress

when i visit any of my websites pages it says : class=”no-js”, but i do have javascript and it is working as wanted. Im using a plugin “Custom javascript” on wordpress, instead of using the hardcoded enqueue functions. But since it is working i dont understand what the problem is. But today another plugin im using stopped showing and gave me this error:
noscript class=”noscript-message”
Message: JavaScript is required for this content.

So clearly something isnt right. Anyone have any idea as to why? below is my javascript code

  jQuery( document ).ready(function() {
      img = new Image();
	div = document.getElementById('sidebar');
	img.onload = function() {
		div.parentNode.insertBefore(img, div.nextSibling).style.marginTop = "-115px";
	};
	img.src = '....../.png';
  x=document.getElementsByClassName("next page-numbers");
    for(var i = 0; i < x.length; i++){
    x[i].innerText="Nästa →";
    }
    y=document.getElementsByClassName("prev page-numbers");
    for(var i = 0; i < y.length; i++){
    y[i].innerText="← Tillbaka";
    }

               jQuery( "li.current_page_item" ).each(function( index ) {
                  jQuery(this).parent('.sub-menu').slideToggle('fast');
                  jQuery(this).parent().parent('.sub-menu').slideToggle('fast');
					jQuery(this).parent().parent().parent('.sub-menu').slideToggle('fast');
                });

                jQuery( "li.current-menu-parent" ).each(function( index ) {
                  jQuery(this).parent('.sub-menu').slideToggle('fast');
                  jQuery(this).parent().parent('.sub-menu').slideToggle('fast');
                  jQuery(this).parent().parent().parent('.sub-menu').slideToggle('fast');
                });
});

Read more here: class="no-js" but javascript is working WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *