Question

I'm using paypal on my wesbite, with generated code from the paypal website. I want to change some parts of this code because I want to remove the paypal "add to cart" default image by a custom text, using jquery.

here is the original part of code :

<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

and I would like to change this by this custom code :

<input type="submit" name="submit" value="Add To Cart" alt="PayPal - The safer, easier way to pay online!">

can anyone help me with this ?

here is a jsfiddle with the original paypal button and with the text to replace the button,

http://jsfiddle.net/DKHR4/1/

thanks a lot for your help,

Was it helpful?

Solution

You could use .replaceWith():

$('input[type="image"][name="submit"][alt]').replaceWith('<input type="submit" name="submit" value="Add To Cart" alt="PayPal - The safer, easier way to pay online!">');

Updated Example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top