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.
Here's the current code on the site
<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( "<?= $p["id"] ?>", "<?= $param_sku ?>", "<?= $output_price ?>", "<?= $path ?>", "<?= $can_buy_limit ?>" ,"<?=$this_page_type?>")'/>
I'm adding this in the Optimizely code editor and it's not working
$('#id-for-test').removeClass('add_to_cart_list').addClass('color-test');