# Prototype help with attaching events

**URL:** <https://forum.kirupa.com/t/prototype-help-with-attaching-events/251433>\
**Category:** web dev\
**Created:** [February 8, 2008, 11:18am UTC](https://forum.kirupa.com/t/prototype-help-with-attaching-events/251433 "2008-02-08T11:18:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qgeis](https://avatars.discourse-cdn.com/v4/letter/q/76d3ee/32.png) [@Qgeis](https://forum.kirupa.com/u/Qgeis)\
**Post date:** [February 8, 2008, 11:18am UTC](https://forum.kirupa.com/t/prototype-help-with-attaching-events/251433/1 "2008-02-08T11:18:36Z")

</div>

I have a bunch of \*\*[COLOR=“RoyalBlue”]\<li\>[/COLOR]\*\*s with [COLOR=“RoyalBlue”]**onclick=“toggleSelection(this)”**[/COLOR] hardcoded into the markup. How do I use Prototype too attach the toggleSelection function to them w/o using onclick?
