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
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025