I am trying to put together a simple proof of concept with a Pinterest PinIt button. We have a product page that displays an image of an item in one color but the user can click a button and see the same product in another color. When the button is clicked, I need to change the link in PinIt button to reflect the current color so if the user tries to Pin the item, it pins the current selected color. Below is a snippet of the code I currently have. I may have missed an escape character or two when I was removing the names and urls or our test servers. (The names have been changed to protect the innocent)

When I click the Show Black button and then click Pin It, it still shows the white image. I'm pretty new to JQuery so any help would be greatly appreciated.

**JS:**

```
$("#button").click(function () {
        var productPage = "http://myproductpage.com";
        var productImage = "http://MyproductimageBlack.jpg";
        var productDescription = "MyProduct";

        var linkValue = "http://pinterest.com/pin/create/button/?url=" + productPage + "&media=" + productImage + "&description=" + productDescription;

        $('#PinLink').attr('href', linkValue);
});

```

**Markup:**

```
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fmyproductpage.com%3D524&amp;media=http%3A%2F%2myproductimagewhite.jpg&amp;description=MyProduct" id="PinLink" class="pin-it-button">
  <img src="//assets.pinterest.com/images/PinExt.png" title="Pin It!" alt="Pin It!" />
</a>

<input type="button" id="button" name="button" value="Show Black"/> 

```