jQuery onclick not firing on dynamically inserted HTML elements?
Do this: where #wrapper is a static element in which you add the dynamic links. So, you have a wrapper which is hard-coded into the HTML source code: and you fill it with dynamic content. The idea is to delegate the events to that wrapper, instead of binding handlers directly on the dynamic elements.