I a developing an app in which I am using
$("#plblAgreeProblem",".plblAgreeComment").live("click", function(){
alert("bil");
}
but class selector is not working. my divs which have class=”plblAgreeComment” are creating dynamically so I am using .live()
Please help me.
IF you are using jQuery version that is newer, and includes “.on” use that:
NOTE: Please try to bind to something closer than “document” if at all possible – like a wrapper for that section of the markup, etc. for speed issues.
Other answers cover previous versions
Here is a working example with it wrapped: http://jsfiddle.net/MarkSchultheiss/pP6nL/