Using delegate() for dynamically added container
Could you explain me how I can catch click event for dynamically added checkbox? I can do it, but can't understand one thing - why can't use delegate() for dynamically added container for checkbox. Code is like that:
<p sty开发者_运维技巧le="blue">
<input type="checkbox" name="first" />
</p>
Example here.
In this example I never catch the message ".blue CLICK" but only see "#ch CLICK".
In your example - When the delegate is initialised the p element with the blue class does not exist. The container you setup the delegate on needs to exist in the dom.
精彩评论