如何从javascript更改Paypal金额值?

时间:2014-11-06 20:37:03

标签: javascript paypal

我有一个函数来计算总计如何使用javascript将数据量的值更改为总计金额?

 <script data-env="sandbox"
                    data-currency="NZD"
                    data-button="buynow" src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=test@test.com"
                    async="async"
                    data-amount="0">

            </script>

任何帮助都会很棒

1 个答案:

答案 0 :(得分:1)

如果您的意思是data-amount ...

var scr=document.getElementsByTagName("script")[0]; // assuming that this <script> is first <script> on this page
scr.setAttribute("data-amount", "some new value");