Trouble adding event listeners via JavaScript
Posted
by Jack Roscoe
on Stack Overflow
See other posts from Stack Overflow
or by Jack Roscoe
Published on 2010-06-07T14:29:40Z
Indexed on
2010/06/07
14:32 UTC
Read the original article
Hit count: 207
JavaScript
|html
Currently I have a function which loops to create multiple HTML objects. Each time an object is created, I want to add an onClick
function listener to that object so that I can trigger a function when each one is clicked.
What's the best way to do this?
Here's the code which creates my objects:
RenderMultipleChoice:function()
{
this.c = paper.rect(this.x, this.y, this.shapeWidth, this.shapeHeight);
}
© Stack Overflow or respective owner