Process function for dynamically added DOM element
<p>I would like to process certain initialization steps whenever an item with a certain class is added anywhere in the DOM. This includes applying some style attributes to its parent (this is why I cannot use CSS), and also binding to the click event.</p>

<p>The following code works when element is static (was already on the page after <code>document.ready</code>):</p>

<pre><code>$(function(){
  //... global initialization code
  $('.myclass').each(function(){
    var parent = $(this).parent();
    parent.css({cursor:'pointer'}); //apply CSS style to the parent
    parent.click(function(event){
      //... event handler
    });        
  });    
});
</code></pre>

<p>Is it possible to convert it to handle dynamically added elements and how?</p>
