Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<div >
<button onclick="openTabs('Description')">Description</button>
<button onclick="openTabs('Reviews')">Reviews</button>
<button onclick="openTabs('Shipping')">Shipping Policy</button>
<div style="margin:10px 0;" id="Description" class="tab">
{{ product.description }}
<div style="margin:10px 0;display:none" id="Reviews" class="tab" >
<div id="shopify-product-reviews" data-id="{{}}">{{ }}</div>
<div style="margin:10px 0;display:none;" id="Shipping" class="tab" >
<h2>Shipping Policy</h2>
function openTabs(tabName) {
var i;
var x = document.getElementsByClassName("tab");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
document.getElementById(tabName).style.display = "block";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment