jQuery append() issue

Hi everyone,

I am having an issue with a small jQuery plugin that I’ve created. In particular, I am using append() to add an extra <LI> to a <UL> list. I am also using the click() event on this list, however the items which are appended via jQuery are being ignored. Is there something that I should be aware of?

Many thanks!

Could you please post some sample code or link us to a demo.

Instead of using .click() I think you want to use .on()

Using either is perfectly valid in jQuery but from v1.5 its recommend you always use .on() as it handles event delegation at the same time.

I didn’t think .click() could apply the event to newly created objects (such as writing a new li tag), but .on() can… Maybe I misread the documentation, but I thought that was one of the advantages of .on versus .click

Ahh my bad, I actually misread a small word in the first post :blush:. You are indeed right on the money cpradio :slight_smile:

Wow, thanks a lot for your great input, guys!