I am having dynamically creating remove label. All have same class but different Ids. I want to get the id when I click a label. I used $(.class).click function but it didn’t work. I can’t use onclick function because $(this).attr('id') is not working in IE 8.
Please give me a solution.
Thanks.
.click doesn’t work on elements that are created later dynamically.
therefore use .live()
Update:
http://api.jquery.com/live/
The above example using .on()