0
我一直在努力寻找解决方法,需要一些帮助。在子串中打印包含特定数字的数组项目的值
在我的网站上,每个用户购物车都会有不同的物品,但是如果某个特定物品在购物车中,我希望将“删除物品”按钮复制到其他位置。
<!-- Here's how Business Catalyst outputs the buttons -->
<div class="cart-item product-remove" style="border:solid 1px black;" >
<div class="productitemcell"><a href="#" onclick="UpdateItemQuantity(0,324897,282161,9383682,336573,'','US');return false;">Remove Item</a></div>
<div class="productitemcell"><a href="#" onclick="UpdateItemQuantity(0,324897,282161,9383705,336574,'','US');return false;">Remove Item</a></div>
<!--the div below contains the button (anchor tag) I want to copy (It will move around the .product-remove div)-->
<div class="productitemcell"><a href="#" onclick="UpdateItemQuantity(0,324897,282161,9383678,336585,'','US');return false;">Remove Item</a></div>
</div>
<div id="sendLinkHere" style="border: 1px solid blue; width: 100%; height:50px;">
<!-- I want the a tag containing "9383678" copied here -->
</div>
这里是JavaScript我有。我知道这不是很多,但这是我的全部。
var divsOfA = document.getElementsByClassName("productitemcell");
console.log($.inArray("9383678",divsOfA));
请?您想在哪个活动中复制标签?你如何区分哪个标签被复制? – 2014-11-06 20:00:39
@ user3491000我的答案能解决您的问题吗? – elzi 2014-11-06 21:14:20