FROM CACHE - en_header
Return management just got easier! We’ve launched Customer Self-Serve Returns to all Shopify merchants. Click here to learn more!

Help with some basic (i think) Java Script

lif-ab
New Member
7 0 0

Hi there,

I am using on my website a JS to switch DIVs with buttons, it works great, however on one page I want to do it twice, and unfortunately after doing the exact same code, only one works now. Is there any way I can get both to work together, maybe creating like a class? Using defer/async?

Not an expert on JS by any means, so may be a silly question.

Worth noting that the 'indepth-grid' class in the code it's for one of the snippets, the other have completely different classes and it's noted on the <script>

Thanks!

<script> 
 function show(param_div_id) {
    document.getElementById('indepth-grid').innerHTML = document.getElementById(param_div_id).innerHTML;
  }
</script>

 

Replies 0 (0)