.click() and .submit() functions do not work on HTML Elements inserted after page has loaded

.click() and .submit() functions do not work on HTML Elements inserted after page has loaded

Hi,
I have a page that inserts a div after another div on my page.  Basically this div and its content are generated by the server and outputted via Ajax when the user clicks a button.

I have something like:

  1. //Listener function
  2. $("div").click( function () {
  3. alert("thing");
  4. });
Clicking any of the divs that were loaded on the page will give this alert however, clicking on this div that was inserted after the user clicks a button does not respond to this listener.  I put my rendered html into the w3c validator and my page has no errors (because I thought that maybe I had a missing end tag which would cause jquery to not work).

Can someone verify this?