HTML not working

Topic summary

A user is attempting to implement a “read more” link that triggers a collapsible content section on a product page, but the HTML/JavaScript code isn’t functioning properly.

Technical Issue:

  • The provided code appears malformed with reversed/garbled text in the HTML snippet
  • One responder identified that the JavaScript needs proper placement in either an onclick attribute or a <script> tag

Proposed Solution:

  • Another contributor suggested adding jQuery code to the theme.liquid file before the </body> tag
  • The code targets product page elements and adds animation/scrolling when the collapsible trigger is clicked

Current Status:

  • Initial implementation attempt failed
  • Console errors are being thrown (screenshot provided)
  • The issue remains unresolved, with one responder offering to help privately if given limited admin access to diagnose the problem

Key Question: Whether to keep or remove the existing HTML code while implementing the suggested fix.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

So i have set up a HTML so that when the text “read more” is clicked- it opens up the collapsible content description at the bottom

I have managed to make it work in the past but this time -it’s not working

Any help would be great - thanks

href=“javascript:e=document.querySelector(‘.collapsible-trigger’);if(e){e.scrollIntoView(true);if(!e.matches(‘.is-open’))e.click()}”>…read more

https://the-body-shop-nordic.myshopify.com/products/himalayan-charcoal-purifying-glow-mask

ubahdo

HI @TBS2023 That is malformed html , the javascript would need to be in an onclick attribute, or in it’s own tag.

If you need this fixed for then contact me for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

HI @TBS2023 ,

Edit you theme.liquid and paste it bellow in file before tag

Thanks

its not working - do i need to keep my html code? or remove it

Hi @TBS2023

It’s throwing an error

Remove the code and paste here as suggest in image,

If not work so please share your admin details in privately with limited permission i will help to fix this.

Thanks

1 Like