I have a list of items
Are you doing this so the whole li block is a clickable link instead of just the a element? If so, you could easily do this with CSS instead.
HTML:
Testing Block Elements
CSS:
#menu {
list-style: none;
padding: 0;
margin: 0;
}
#menu li {
/* Added to show the whole li element will be a clickable link. */
width: 250px;
border: 1px solid #000000;
}
#menu li a {
display: block;
}
EDIT:
And by doing this, you only need to attach the click event to the a tag if you really need to do some javascript when the user clicks on it.