Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda