UPDATE
Update:
After following Zach Saucier's instructions, I added the specified codes:
JS
this.onclick = function() { this.style.background = "red"; this.innerHTML = "Bought"; }
So the button displays as:
<a onclick="javascript:func(this)" class="ajax_add_to_cart_button comprar_mat" rel="ajax_id_product_14" href="../cart.php?add&id_product=14" id="matricularme">Matricularme</a>
Despite these changes, the button still does not work
I am attempting to add some effects on buttons within my website but am facing difficulties.
The HTML link (displayed as a button) appears like this:
<td class="marker">
<a class="ajax_add_to_cart_button comprar_mat" rel="ajax_id_product_14" href="../cart.php?add&id_product=14">Buy it now!</a>
</td>
This particular button is used to add a product on my website, and I simply want to replace the entire text with "Bought" and modify the background as well.
What approach should I take for this? Should I utilize jQuery? Or maybe implement a CSS style where one sprite image represents "Buy it now!" and "Bought", allowing me to just change the background position?
Thank you