how to Detect Click inside iframe

how to Detect Click inside iframe

Dear All

My Code
  1.  var iframesrc='imageeditingslider.php?id='+thisid;
  2.  $('#categorylist').html( '<iframe id="datamain" src="'+iframesrc+'" width="100%" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>' );
  3.    });
This code creates a iframe.
 
.showallediting -> contents has  this class


I am tried following code

  1. $('#tdatamain').contents().find(".showallediting").click(function(){      
  2.              
  3.                 alert('clicked img');
  4.             }
please please help