I currently have a list of items with a Paypal button associated with each of them. Each item will be purchased separately by clicking on its associated button.
<ul>
<li data-id="1">Item 1 <div class="paypal-button"></div></li>
<li data-id="2">Item 2 <div class="paypal-button"></div></li>
<li data-id="3">Item 3 <div class="paypal-button"></div></li>
</ul>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
// options
}, '.paypal-button');
</script>
Unfortunately, it seems that paypal.Button.render()
will only render the first element that it finds.
Is it possible to do this call on multiple elements?