how do I add event handlers to each individual item items?

I'm trying to add a onclick event to call theMethod, and at the same time, it will pass it an id to tell the javascript which item id was clicked.

```
function theMethod(id) {

}

```