Replacing a class on multiple pages with Optimizely
<p>I'm trying to set up an A/B test using Optimizely to change the color of the add to cart button on all product pages on the site. </p>

<p>Here's the current code on the site</p>

<pre><code>&lt;input id="id-for-test" class="add_to_cart_list" value="Add to Cart" name="Add to Cart" type="button"
                                                    onclick='sendToDataLayer("Category Lower", "Add to cart");return cat_add_one_to_cart( "&lt;?= $p["id"] ?&gt;", "&lt;?= $param_sku ?&gt;", "&lt;?= $output_price ?&gt;", "&lt;?= $path ?&gt;", "&lt;?= $can_buy_limit ?&gt;" ,"&lt;?=$this_page_type?&gt;")'/&gt;
</code></pre>

<p>I'm adding this in the Optimizely code editor and it's not working</p>

<pre><code>$('#id-for-test').removeClass('add_to_cart_list').addClass('color-test');
</code></pre>