Buttons created through jquery don't respond to clicks
Posted
by
Atrus
on Stack Overflow
See other posts from Stack Overflow
or by Atrus
Published on 2012-03-22T05:03:10Z
Indexed on
2012/03/22
5:29 UTC
Read the original article
Hit count: 136
JavaScript
|jQuery
As I've come to understand using $('.whatever').click() only works for items created initially. Additional items won't respond in the correct fashion. I was then directed to using something like $('.whatever).on('click', myFunction()). However, I'm not detecting any difference, as newly created items are not called.
Here is a JSFiddle demonstration my example code: http://jsfiddle.net/atrus6/zaKZN/
My initial input plus 'Kill' will work in the correct fashion, however any additional 'input + kill's will not not do anything. Am I incorrectly using .on() or is it something else?
© Stack Overflow or respective owner