Can anyone help PLEASE?

I'm creating a shopping cart.

I wish to use Javascript to add an item to a cookie (the cart) from an HTML page of all the items in the shop. Each item will have an "Add" button. I'm assuming the process will involve the 'onClick' attribute...?

Can anyone tell me how to implement this and how to add multiple items to the same cart/cookie?

Thank you