Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!