UPDATE: THERE ARE 12 of these on one page. Only the last one works. They all have unique ID's and a unique function written for them though.
This simple function is working on my development site but not my live site for some reason. It is a wordpress install but they should be exactly the same setup. I haven't written additional functions or anything. Any ideas? I thought maybe a plugin was stopping it but after testing that hasn't been the case. I have no idea how to troubleshoot javascript using developer tools.
function quantChange() {
d = document.getElementById("bwoo-quantity-187").value;
document.getElementById("187").setAttribute('data-quantity',d);
}
Input being used
<select class='quantity' onchange='quantChange()' id='bwoo-quantity-187'>
<option value=0>0</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
</select>
Item I'm trying to change:
<form action="/order-now/a-la-carte/?add-to-cart=187" class="cart-nonmealplan" method="post" enctype="multipart/form-data">
<button type="submit" id="187" data-product_id="187" data-product_sku="" data-quantity="1" class="add_to_cart_button button product_type_simple">Add to cart</button>
</form>