Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
JavaScript code not working in HTML page but it works in Console

I am trying to add JavaScript code to show and hide some content with JQuery to my HTML page. When I add it in HTML code or in javaScript file with .js or in head or footer block the code is added and show in HTML code but it is not working. But when I add to test my same code in the console in the developer tool(Inspect) the code is working. I can't understand what is the issue. I am working on the page: https://radiusofficefurniture.ie/jemini-intro-1200-modular-straight-base-unit-maple-1200masama--1 The code is:

$(document).ready(function(){
    var lenth_2 = $('.add_to_cart_custom .delivery--information').children().length;
    if( lenth_2 > 1 ){
        $('.add_to_cart_custom .delivery--information').hide();
        $("p.delivery_custom").parent('.add_to_cart_custom .delivery--information').show();
        $(".product_specs2 .item.attr_item_lead_time").hide();
    }
});

And also when I add some other JS code to this page for other functionality the same issue occurs. And the issue only appears only on single products pages that have the same layout. For other pages, JS works when I add in Html.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda