Answer the question
In order to leave comments, you need to log in
How to replace href when clicking on a link button?
When you click on Buy, the text is replaced with Already in the cart.
How can I change the link to /cart/?
<script>
var about_bears = "Уже в корзине";
</script>
<a
onclick="document.getElementById('<?=$arCurOffer['ID']?>').innerHTML = about_bears"
data-element-id="<?=$arCurOffer['ID']?>"
href="javascript:void(0);"
class="cartochka__btn-to-basket btn-black cartochka__btn-to-basket_contact-lens">
<div id="<?=$arCurOffer['ID']?>">Купить</div>
</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question