jQuery.find on newly created elements alert($('<p id="aa">xxx</p>').find("#aa").length);

Posted by Sqlclown on Stack Overflow See other posts from Stack Overflow or by Sqlclown
Published on 2010-04-13T19:17:28Z Indexed on 2010/04/13 19:23 UTC
Read the original article Hit count: 172

Filed under:

I am trying to lookup elements within a dynamically created element. For some reason this fails. Why does the following return "0"? How to fix this?

  alert($('<p id="aa">xxx</p>').find("#aa").length);

© Stack Overflow or respective owner

Related posts about jQuery