The second .click() function is not working
<p>The first .click function is used to add an element(div) in a container and the second one is used to remove it from the container. The container initially has no elements. The removing of the function by clicking on it is not working</p>

<pre><code>$(document).ready(function(){
    $(".class1").click(function(){
       //Code for adding element to the container and 
       // removing class1 from it and adding class2

    });

    $(".class2").click(function(){
       alert("hi");   //Even the alert is not displayed
       $(this).fadeOut(100);    
    });
});
</code></pre>

<p>However, it works if the element is already there before the page loads in the container.
Any reasons why? Is it because of document.ready function? Solutions?</p>
