Access dynamically loaded html element

ndkmusic

New Member
I am Trying to load some html in my document with ajax.The loading is working just file, what i am not able to do is access the loaded html with jquery selectors.Here is the script :\[code\]$(document).ready(function(){ $.ajax({ url: 'header.html', dataType: 'html', success: function(data) { $("#header").html(data); });});\[/code\]Html :\[code\] <body> <div id="wrapper"> <div id="header"> </div><!--header end--> </div> </body>\[/code\]I am trying to access html elements like this :\[code\]$('#bigmenu').hide();$('#mydiv').mouseenter(function(e){ $('#bigmenu').fadeIn(100);});\[/code\]\[code\]#bigmenu\[/code\] and \[code\]#mydiv\[/code\] are elements of dynamically loaded htmlHowever it works if i try to access them inside ajax \[code\]success\[/code\] function.My question is - How can i access them outside of success function ?
 
Back
Top