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
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025