我试图提示一个值来替换“数据量”的值,你会怎么做呢?
<html>
<body>
<a href="http://google.com/" class="dwolla_button" data-name="Lease" data-desc="Payments" data-amount="4" data-shipping="0" data-tax="0" data-guest-checkout="true" data-key="xxxxx">Bank </a>
<script type="text/javascript" src="https://www.dwolla.com/scripts/button.min.js"> </script>
</body>
</html>
我试图以这种方式替换使用javascript
<script>
document.getElementByClass("dwolla_button").data-amount="43";
</script>
并考虑过像这样使用jquery,但不知道如何首先加载jquery
$("a").attr("data_amount", "43")
有任何想法吗?
我完全尝试过的整个代码是
<html>
<body>
<a href="http://249lease.webs.com/" class="dwolla_button" data-name="Lease" data-desc="Payments" data-amount="5" data-shipping="0" data-tax="0" data-guest-checkout="true" data-key="sHqCOc31Vh3JiAsPhBfEk5f4D9bAWKLzwaT06ah3Aw65i0gkZl">Bank Account (25¢)</a>
<script type="text/javascript">
document.getElementByClass("dwolla_button")[0].setAttribute("data-amount", "43");
</script>
<script type="text/javascript" src="https://www.dwolla.com/scripts/button.min.js"> </script>
</body>
</html>