I'm building Custom Cart, where i show product detail on same page in Popup model with jQuery onclick, But on Popup window i also want to update product_ID on "Add to Cart" Button in onclick's first Parameter, Here is the code for demonsration:
Product Thumbnail:
<div id="product">
<img src="http://placehold.it/250x150" />
<input type="hidden" value="159" />
</div>
Popup Add to Cart Button
<a href="#" onclick="add_to_cart('Product_ID', 'Product_Price');">Add to Cart</a>
what i want is when i click on product <div id="product"> than the value in the hidden input is also updated on Add to Cart button with first parameter of onclick attr which is Product_ID, any help regarding this would be highly appreciable.