views:

987

answers:

2

I have a main page from where I am making a call to "load" and intermediate page's HTML and on the completion of the load I am massaging the returned HTML to add a few DIVs etc, when I try to bind an onclick event for the dynamic Divs (added by me after the HTML returned from the intermediate page) it does not seem to work at all !:

LOAD :

$j(".loader").load(myURLtoIntermediatePage, '', function() {
     var HTML= '<div id="abcd">test</div>';
     ...

     $j(".pageDIV").append(HTML);    
}

DOCUMENT READY Function

$j(document).ready(function() {

 $j('#abcd').onclick(function() {
            alert($j(this));
        });

});
+4  A: 

This requires jQuery 1.3:

$j("#abcd").live("click", function() {
    alert($j(this));
});
Joe Chung
wicked ! Thanks ! :)
Murtaza RC
A: 

Thanks This is great help to me

Mahendra vala

Mahendra