Ecommerce Shopping Cart - "Empty Cart" or "Clear Cart" button

Where do I put this code exactly? Am I also supposed to create a button with a class that the JQuery targets as well? do I put this in the head, before body, or on the cart wrapper itself as an embedded code?