Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello @PernillaH
You can use below code.
<div id="product-description" class="product-description">
{{ product.description }}
</div>
<button onclick="myFunction()" class="read-button" id="read-more">Read More</button>
<button onclick="myFunction1()" class="read-button d-none" id="read-less">Read Less</button>
<script>
function myFunction1() {
var element = document.getElementById("product-description");
element.classList.remove("mystyle");
var readmore = document.getElementById("read-more");
var readless = document.getElementById("read-less");
readless.classList.add("d-none");
readmore.classList.remove("d-none");
}
function myFunction() {
var element = document.getElementById("product-description");
element.classList.add("mystyle");
var readmore = document.getElementById("read-more");
var readless = document.getElementById("read-less");
readless.classList.remove("d-none");
readmore.classList.add("d-none");
}
</script>
Thank You
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025