binding events on jquery created DOM elements
<p>I like to create jquery elements in variables and place them where needed.</p>

<pre><code>var $someElement = $("&lt;span class='someclass'&gt;something&lt;/span&gt;").css("cursor", "pointer");
$("body").append($someElement)
</code></pre>

<p>for now everything is working. But if i try to bind a event to this element, the event does not get triggered:</p>

<pre><code>var $someElement = $("&lt;span class='someclass'&gt;something&lt;/span&gt;").css("cursor", "pointer").click(function(){ alert("yeah") });
$("body").append($someElement)
</code></pre>

<p>but if i append the element and the find the span by its class it works.</p>

<p>Why is this and how should i handle events on elements that are created but not yet apended?</p>
