I'm trying to get a product id value inside a add to cart button. The below code works getting the value in an alert.
<script type="text/javascript">
jQuery(document).ready(function(e) {
jQuery('#getChkBoxValues').click(function(){
var chkBoxArray = [];
jQuery('.checkbox-id:checked').each(function() {
chkBoxArray.push(jQuery(this).val());
});
alert(chkBoxArray);
});
});
</script>
<input type="button" value="Get Values" id="getChkBoxValues" />
Is there any way to get the value inside this button (below) where the number 5 is without any additional span, div, or script tags?
<button id="product-addtocart-button" class="button btn-cart" onclick="location.href='<?php echo Mage::getStoreConfig(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL); ?>checkout/cart/add?product=5&qty=1'"><span><span><?php echo $this->__('Add All to Cart') ?></span></span></button>