jQuery detect event in appended element
<p>I am trying to detect an event in a jQuery appended element. </p>

<ul>
<li>How do you do this, </li>
<li>and/or why isn't this working:</li>
</ul>

<p>Here's a simplified snippet of what I've tried. The input field fires after clicking "click me." After clicking on the input, the alert isn't firing - other events on this appended input don't fire either. :-(</p>

<p>The following's in script tags:</p>

<pre><code>$(document).ready(function(){   
  $(".clickme").click(function(){$(".extra").append('write: &lt;input type="text" class="writesomething" /&gt;');});
  $("input").click(function(){alert("clicked")});
});
</code></pre>

<p>The following's in the body:</p>

<pre><code>&lt;a href="#" onclick="return false" class="clickme"&gt;click me&lt;/a&gt;
&lt;div class="extra"&gt;&lt;/div&gt;
</code></pre>
