I'm trying to dynamically set the contents of a div on my page and then call a Jquery method, ala:
document.all("menu").innerHtml = menuHtml;
$('ul.sf-menu').superfish();
However the $('ul.sf-menu')
part of the above fails to find any elements (menuHtml does definitely contian a <ul />
with class sf-menu
)
I'm very new to jquery and I'm struggling to understand why this fails to find my newly added element. Is it because its been dynamically added to the DOM, or is it that jquery isn't searching "everywhere"?