Send onClick to another field

How can I go about getting a response from an onClick function send that field element to another field (div)? Kind of like a shopping cart would do but with no server interaction. Just click and then a div would list what you just clicked. And if you clicked something else it would show that below and add text element to div.